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>,
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,
Amit Daniel Kachhap <amit.daniel@samsung.com>,
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 part2 PATCH 7/9] irqdomain: Add a new API irq_create_acpi_mapping()
Date: Wed, 04 Dec 2013 23:38:56 +0800 [thread overview]
Message-ID: <529F4C90.4070402@linaro.org> (raw)
In-Reply-To: <CAL_JsqK93mJbFu+GaK_5L14jKnMgctUNdEBqS6K5zKer16Sm3Q@mail.gmail.com>
On 2013年12月04日 01:25, Rob Herring wrote:
> On Tue, Dec 3, 2013 at 10:39 AM, Hanjun Guo <hanjun.guo@linaro.org> wrote:
>> From: Amit Daniel Kachhap <amit.daniel@samsung.com>
>>
>> This patch introduces a new API for acpi based irq mapping.
>>
>> [hanjun: Rework this patch to delete the reference to
>> gic_irq_domain_xlate() which can simplify the code a lot.]
>>
>> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>> ---
>> include/linux/acpi.h | 2 ++
>> kernel/irq/irqdomain.c | 27 +++++++++++++++++++++++++++
>> 2 files changed, 29 insertions(+)
>>
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index 1e6a0ac..edd5806 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -141,6 +141,8 @@ int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu);
>> int acpi_unmap_lsapic(int cpu);
>> #endif /* CONFIG_ACPI_HOTPLUG_CPU */
>>
>> +unsigned int irq_create_acpi_mapping(irq_hw_number_t hwirq,
>> + unsigned int type);
>> int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
>> int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
>> void acpi_irq_stats_init(void);
>> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
>> index cf68bb3..c661552 100644
>> --- a/kernel/irq/irqdomain.c
>> +++ b/kernel/irq/irqdomain.c
>> @@ -501,6 +501,33 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
>> }
>> EXPORT_SYMBOL_GPL(irq_create_of_mapping);
>>
>> +#ifdef CONFIG_ACPI
>> +unsigned int irq_create_acpi_mapping(irq_hw_number_t hwirq,
>> + unsigned int type)
>> +{
>> + struct irq_domain *domain;
>> + unsigned int virq;
>> +
>> + domain = irq_default_domain;
>> + if (!domain) {
>> + pr_warn("no irq domain found !\n");
>> + return 0;
>> + }
>> +
>> + /* Create mapping */
>> + virq = irq_create_mapping(domain, hwirq);
>> + if (!virq)
>> + return virq;
>> +
>> + /* Set type if specified and different than the current one */
>> + if (type != IRQ_TYPE_NONE &&
>> + type != irq_get_trigger_type(virq))
>> + irq_set_irq_type(virq, type);
>> + return virq;
>> +}
>> +EXPORT_SYMBOL_GPL(irq_create_acpi_mapping);
> There is nothing ACPI specific about this function. This is simply
> irq_create_of_mapping w/o translating of_phandle_args to a hwirq and
> type. So I expect the code to be re-factored here to mirror that.
Sorry for my bad english, do you mean create a OF free function
and call that from the OF function ?
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
WARNING: multiple messages have this Message-ID (diff)
From: hanjun.guo@linaro.org (Hanjun Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC part2 PATCH 7/9] irqdomain: Add a new API irq_create_acpi_mapping()
Date: Wed, 04 Dec 2013 23:38:56 +0800 [thread overview]
Message-ID: <529F4C90.4070402@linaro.org> (raw)
In-Reply-To: <CAL_JsqK93mJbFu+GaK_5L14jKnMgctUNdEBqS6K5zKer16Sm3Q@mail.gmail.com>
On 2013?12?04? 01:25, Rob Herring wrote:
> On Tue, Dec 3, 2013 at 10:39 AM, Hanjun Guo <hanjun.guo@linaro.org> wrote:
>> From: Amit Daniel Kachhap <amit.daniel@samsung.com>
>>
>> This patch introduces a new API for acpi based irq mapping.
>>
>> [hanjun: Rework this patch to delete the reference to
>> gic_irq_domain_xlate() which can simplify the code a lot.]
>>
>> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>> ---
>> include/linux/acpi.h | 2 ++
>> kernel/irq/irqdomain.c | 27 +++++++++++++++++++++++++++
>> 2 files changed, 29 insertions(+)
>>
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index 1e6a0ac..edd5806 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -141,6 +141,8 @@ int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu);
>> int acpi_unmap_lsapic(int cpu);
>> #endif /* CONFIG_ACPI_HOTPLUG_CPU */
>>
>> +unsigned int irq_create_acpi_mapping(irq_hw_number_t hwirq,
>> + unsigned int type);
>> int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
>> int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
>> void acpi_irq_stats_init(void);
>> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
>> index cf68bb3..c661552 100644
>> --- a/kernel/irq/irqdomain.c
>> +++ b/kernel/irq/irqdomain.c
>> @@ -501,6 +501,33 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
>> }
>> EXPORT_SYMBOL_GPL(irq_create_of_mapping);
>>
>> +#ifdef CONFIG_ACPI
>> +unsigned int irq_create_acpi_mapping(irq_hw_number_t hwirq,
>> + unsigned int type)
>> +{
>> + struct irq_domain *domain;
>> + unsigned int virq;
>> +
>> + domain = irq_default_domain;
>> + if (!domain) {
>> + pr_warn("no irq domain found !\n");
>> + return 0;
>> + }
>> +
>> + /* Create mapping */
>> + virq = irq_create_mapping(domain, hwirq);
>> + if (!virq)
>> + return virq;
>> +
>> + /* Set type if specified and different than the current one */
>> + if (type != IRQ_TYPE_NONE &&
>> + type != irq_get_trigger_type(virq))
>> + irq_set_irq_type(virq, type);
>> + return virq;
>> +}
>> +EXPORT_SYMBOL_GPL(irq_create_acpi_mapping);
> There is nothing ACPI specific about this function. This is simply
> irq_create_of_mapping w/o translating of_phandle_args to a hwirq and
> type. So I expect the code to be re-factored here to mirror that.
Sorry for my bad english, do you mean create a OF free function
and call that from the OF function ?
Thanks
Hanjun
WARNING: multiple messages have this Message-ID (diff)
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>,
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,
Amit Daniel Kachhap <amit.daniel@samsung.com>,
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 part2 PATCH 7/9] irqdomain: Add a new API irq_create_acpi_mapping()
Date: Wed, 04 Dec 2013 23:38:56 +0800 [thread overview]
Message-ID: <529F4C90.4070402@linaro.org> (raw)
In-Reply-To: <CAL_JsqK93mJbFu+GaK_5L14jKnMgctUNdEBqS6K5zKer16Sm3Q@mail.gmail.com>
On 2013年12月04日 01:25, Rob Herring wrote:
> On Tue, Dec 3, 2013 at 10:39 AM, Hanjun Guo <hanjun.guo@linaro.org> wrote:
>> From: Amit Daniel Kachhap <amit.daniel@samsung.com>
>>
>> This patch introduces a new API for acpi based irq mapping.
>>
>> [hanjun: Rework this patch to delete the reference to
>> gic_irq_domain_xlate() which can simplify the code a lot.]
>>
>> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>> ---
>> include/linux/acpi.h | 2 ++
>> kernel/irq/irqdomain.c | 27 +++++++++++++++++++++++++++
>> 2 files changed, 29 insertions(+)
>>
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index 1e6a0ac..edd5806 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -141,6 +141,8 @@ int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu);
>> int acpi_unmap_lsapic(int cpu);
>> #endif /* CONFIG_ACPI_HOTPLUG_CPU */
>>
>> +unsigned int irq_create_acpi_mapping(irq_hw_number_t hwirq,
>> + unsigned int type);
>> int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
>> int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
>> void acpi_irq_stats_init(void);
>> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
>> index cf68bb3..c661552 100644
>> --- a/kernel/irq/irqdomain.c
>> +++ b/kernel/irq/irqdomain.c
>> @@ -501,6 +501,33 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
>> }
>> EXPORT_SYMBOL_GPL(irq_create_of_mapping);
>>
>> +#ifdef CONFIG_ACPI
>> +unsigned int irq_create_acpi_mapping(irq_hw_number_t hwirq,
>> + unsigned int type)
>> +{
>> + struct irq_domain *domain;
>> + unsigned int virq;
>> +
>> + domain = irq_default_domain;
>> + if (!domain) {
>> + pr_warn("no irq domain found !\n");
>> + return 0;
>> + }
>> +
>> + /* Create mapping */
>> + virq = irq_create_mapping(domain, hwirq);
>> + if (!virq)
>> + return virq;
>> +
>> + /* Set type if specified and different than the current one */
>> + if (type != IRQ_TYPE_NONE &&
>> + type != irq_get_trigger_type(virq))
>> + irq_set_irq_type(virq, type);
>> + return virq;
>> +}
>> +EXPORT_SYMBOL_GPL(irq_create_acpi_mapping);
> There is nothing ACPI specific about this function. This is simply
> irq_create_of_mapping w/o translating of_phandle_args to a hwirq and
> type. So I expect the code to be re-factored here to mirror that.
Sorry for my bad english, do you mean create a OF free function
and call that from the OF function ?
Thanks
Hanjun
next prev parent reply other threads:[~2013-12-04 15:39 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 16:39 [RFC part2 PATCH 0/9] Using ACPI MADT table to initialise SMP and GIC Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 1/9] ARM64 / ACPI: Implement core functions for parsing MADT table Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 2/9] ARM64 / ACPI: Prefill cpu possible/present maps and map logical cpu id to APIC id Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 16:57 ` One Thousand Gnomes
2013-12-03 16:57 ` One Thousand Gnomes
2013-12-03 16:57 ` One Thousand Gnomes
2013-12-04 14:21 ` Hanjun Guo
2013-12-04 14:21 ` Hanjun Guo
2013-12-04 14:21 ` Hanjun Guo
2013-12-04 15:40 ` Rob Herring
2013-12-04 15:40 ` Rob Herring
2013-12-04 15:40 ` Rob Herring
2013-12-04 15:47 ` Rob Herring
2013-12-04 15:47 ` Rob Herring
2013-12-05 13:24 ` Mark Brown
2013-12-05 13:24 ` Mark Brown
2013-12-05 13:34 ` Hanjun Guo
2013-12-05 13:34 ` Hanjun Guo
2013-12-05 23:09 ` Arnd Bergmann
2013-12-05 23:09 ` Arnd Bergmann
2013-12-09 8:06 ` Hanjun Guo
2013-12-09 8:06 ` Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 3/9] ARM64 / ACPI: Introduce map_gic_id() to get apic id from MADT or _MAT method Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 4/9] ARM64 / ACPI: Use Parked Address in GIC structure for spin table SMP initialisation Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 5/9] ACPI: Define ACPI_IRQ_MODEL_GIC needed for arm Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 6/9] Irqchip / gic: Set as default domain so we can access from ACPI Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 7/9] irqdomain: Add a new API irq_create_acpi_mapping() Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 17:25 ` Rob Herring
2013-12-03 17:25 ` Rob Herring
2013-12-04 15:38 ` Hanjun Guo [this message]
2013-12-04 15:38 ` Hanjun Guo
2013-12-04 15:38 ` Hanjun Guo
2013-12-10 10:06 ` Linus Walleij
2013-12-10 10:06 ` Linus Walleij
2013-12-03 16:39 ` [RFC part2 PATCH 8/9] ACPI / ARM64: Update acpi_register_gsi to register with the core IRQ subsystem Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-05 3:48 ` Arnd Bergmann
2013-12-05 3:48 ` Arnd Bergmann
2013-12-05 14:01 ` Hanjun Guo
2013-12-05 14:01 ` Hanjun Guo
2013-12-05 14:01 ` Hanjun Guo
2013-12-03 16:39 ` [RFC part2 PATCH 9/9] ACPI / GIC: Initialize GIC using the information in MADT Hanjun Guo
2013-12-03 16:39 ` Hanjun Guo
2013-12-03 17:09 ` Rob Herring
2013-12-03 17:09 ` Rob Herring
2013-12-04 14:58 ` Hanjun Guo
2013-12-04 14:58 ` Hanjun Guo
2013-12-03 17:26 ` Marc Zyngier
2013-12-03 17:26 ` Marc Zyngier
2013-12-03 17:26 ` Marc Zyngier
2013-12-04 15:32 ` Hanjun Guo
2013-12-04 15:32 ` Hanjun Guo
2013-12-04 15:32 ` Hanjun Guo
2013-12-04 15:50 ` Marc Zyngier
2013-12-04 15:50 ` Marc Zyngier
2013-12-04 15:50 ` Marc Zyngier
2013-12-05 13:41 ` Hanjun Guo
2013-12-05 13:41 ` Hanjun Guo
2013-12-05 13:41 ` Hanjun Guo
2013-12-09 18:54 ` Olof Johansson
2013-12-09 18:54 ` Olof Johansson
2013-12-09 18:54 ` Olof Johansson
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=529F4C90.4070402@linaro.org \
--to=hanjun.guo@linaro.org \
--cc=amit.daniel@samsung.com \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=daniel.lezcano@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.