On 2013-03-27 13:55, Gilles Chanteperdrix wrote:
> Ok, how about this one:
> 
> iff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
> index 11e75d1..47d1d27 100644
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -256,13 +256,19 @@ void mask_irq(struct irq_desc *desc)
>  void unmask_irq(struct irq_desc *desc)
>  {
>       unsigned long flags;
> -
> +     
> +     flags = hard_cond_local_irq_save();
> +#ifdef CONFIG_IPIPE
> +     if (desc->irq_data.chip->irq_release) {
> +             desc->irq_data.chip->irq_release(&desc->irq_data);
> +             irq_state_clr_masked(desc);

Are you sure that every call to unmask_irq implies (under I-pipe) that
the IRQ was held before so that release_irq is appropriate here? Or did
you rather want to patch cond_unmask_irq this way? But that has
unfortunately also more users than our fast_eoi path.

> +     } else
> +#endif /* CONFIG_IPIPE */
>       if (desc->irq_data.chip->irq_unmask) {
> -             flags = hard_cond_local_irq_save();
>               desc->irq_data.chip->irq_unmask(&desc->irq_data);
>               irq_state_clr_masked(desc);
> -             hard_cond_local_irq_restore(flags);
>       }
> +     hard_cond_local_irq_restore(flags);
>  }
>  
>  /*
> @@ -463,8 +469,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc 
> *desc)
>  
>  #ifdef CONFIG_IPIPE
>       /* XXX: IRQCHIP_EOI_IF_HANDLED is ignored. */
> -     if (desc->irq_data.chip->irq_release)
> -             desc->irq_data.chip->irq_release(&desc->irq_data);
> +     cond_unmask_irq(desc);

I'm wondering now why we need this differently for the I-pipe case.

Let's revisit what happens with a fasteoi normally:

- it's masked only if it's a oneshot IRQ before calling the flow handler
- it's unmasked after the flow handling if the thread was not woken up

With I-pipe we already enter handle_fasteoi_irq with the IRQ masked. The
conditions and spots to unmask are:
- from handle_fasteoi_irq if the thread wasn't woken up or we have
  non-threaded or non-oneshot handling
- otherwise on end_irq from the handler thread

Do you think this is correct? If so, I do not think it matches this
patch yet.

Jan

>  out_eoi:
>  #else  /* !CONFIG_IPIPE */
>       if (desc->istate & IRQS_ONESHOT)
> @@ -682,12 +687,15 @@ void __ipipe_end_level_irq(unsigned irq, struct 
> irq_desc *desc)
>  void __ipipe_ack_fasteoi_irq(unsigned irq, struct irq_desc *desc)
>  {
>       desc->irq_data.chip->irq_hold(&desc->irq_data);
> +     irq_state_set_masked(desc);     
>  }
>  
>  void __ipipe_end_fasteoi_irq(unsigned irq, struct irq_desc *desc)
>  {
> -     if (desc->irq_data.chip->irq_release)
> +     if (desc->irq_data.chip->irq_release) {
> +             irq_state_clr_masked(desc);             
>               desc->irq_data.chip->irq_release(&desc->irq_data);
> +     }
>  }
>  
>  void __ipipe_ack_edge_irq(unsigned irq, struct irq_desc *desc)
> 
> 
> 

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux

_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to