On Wed, 2010-10-13 at 16:52 +0200, Philippe Gerum wrote: > > > > Should we test IPIPE_STALL_FLAG on all but current CPUs? > > That would solve this particular issue, but we should drain the pipeline > out of any Xenomai critical section. The way it is done now may induce a > deadlock (e.g. CPU0 waiting for CPU1 to acknowledge critical entry in > ipipe_enter_critical when getting some IPI, and CPU1 waiting hw IRQs off > for CPU0 to release the Xenomai lock that annoys us right now). > > I'll come up with something hopefully better and tested in the next > days. >
Sorry for the lag. In case that helps, here is another approach, based on telling the pipeline to ignore the irq about to be detached, so that it passes all further occurrences down to the next domain, without handling any on the target domain anymore. Once this operation is done, we are safe, and no handler for this interrupt could run in parallel on other CPUs for the given domain, while we attempt to clear it in the domain's IRQ descriptor. Said differently, the inserted code tells the pipeline to skip the target domain when handling the interrupt. For this to work, we have to ignore the irq before we enter the irqs off section which disables the interrupt descriptor in Xenomai (breaking the section across the IRQ unregistration call - i.e. xnarch_release_irq() - would introduce a race). Patches against 2.6.35.7 and Xenomai 2.5.5.2, but the backport should be reasonably straightforward. HTH, Cherry-pick these commits for the I-pipe part: http://git.denx.de/?p=ipipe-2.6.git;a=commit;h=b786b2c5963d5884d60f265a6efc40276d8487e2 http://git.denx.de/?p=ipipe-2.6.git;a=commit;h=ca5f69024fec66c7b25d9b5b6507501c4a47c3a9 And the rest is on top of Xenomai 2.5.5.2: http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=737e3bb09e2364658cfc59a0037f5e39a81fb799 http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=5ee600768743906342a350ecbca51a01ca5689b4 -- Philippe. _______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
