Re: [PATCH 37/37] powerpc: make IRQ_NOREQUEST last to clear, first to set
From: Grant Likely <hidden>
Date: 2011-05-11 19:18:33
On Wed, May 11, 2011 at 7:30 AM, Milton Miller [off-list ref] wrote:
When allocating irqs, wait to clear the IRQ_NOREQUEST flag until the host map hook has been called. When freeing irqs, set the IRQ_NOREQUEST flag before calling the host unmap hook.
A description describing why this change is being made would be appreciated here. g.
quoted hunk ↗ jump to hunk
Signed-off-by: Milton Miller <redacted> --- =A0arch/powerpc/kernel/irq.c | =A0 14 +++++++------- =A01 files changed, 7 insertions(+), 7 deletions(-)diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 4368b5e..a24d37d 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c@@ -586,14 +586,14 @@ struct irq_host *irq_alloc_host(struct device_node =
*of_node,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq_map[i].host =3D host; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0smp_wmb(); - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Clear norequest flags */ - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_clear_status_flags(i, I=
RQ_NOREQUEST);
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Legacy flags are left t=
o default at this point,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * one can then use irq_cr=
eate_mapping() to
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * explicitly change them =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ops->map(host, i, i); + + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Clear norequest flags */ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_clear_status_flags(i, I=
RQ_NOREQUEST);
quoted hunk ↗ jump to hunk
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; =A0 =A0 =A0 =A0case IRQ_HOST_MAP_LINEAR:@@ -664,8 +664,6 @@ static int irq_setup_virq(struct irq_host *host, unsi=
gned int virq,
quoted hunk ↗ jump to hunk
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto error; =A0 =A0 =A0 =A0} - =A0 =A0 =A0 irq_clear_status_flags(virq, IRQ_NOREQUEST); - =A0 =A0 =A0 =A0/* map it */ =A0 =A0 =A0 =A0smp_wmb(); =A0 =A0 =A0 =A0irq_map[virq].hwirq =3D hwirq;@@ -676,6 +674,8 @@ static int irq_setup_virq(struct irq_host *host, unsi=
gned int virq,
quoted hunk ↗ jump to hunk
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto errdesc; =A0 =A0 =A0 =A0} + =A0 =A0 =A0 irq_clear_status_flags(virq, IRQ_NOREQUEST); + =A0 =A0 =A0 =A0return 0; =A0errdesc:@@ -819,6 +819,8 @@ void irq_dispose_mapping(unsigned int virq)=A0 =A0 =A0 =A0if (host->revmap_type =3D=3D IRQ_HOST_MAP_LEGACY) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; + =A0 =A0 =A0 irq_set_status_flags(virq, IRQ_NOREQUEST); + =A0 =A0 =A0 =A0/* remove chip and handler */ =A0 =A0 =A0 =A0irq_set_chip_and_handler(virq, NULL, NULL);@@ -848,8 +850,6 @@ void irq_dispose_mapping(unsigned int virq)=A0 =A0 =A0 =A0smp_mb(); =A0 =A0 =A0 =A0irq_map[virq].hwirq =3D host->inval_irq; - =A0 =A0 =A0 irq_set_status_flags(virq, IRQ_NOREQUEST); - =A0 =A0 =A0 =A0irq_free_descs(virq, 1); =A0 =A0 =A0 =A0/* Free it */ =A0 =A0 =A0 =A0irq_free_virt(virq, 1); -- 1.7.0.4
--=20 Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.