Hi Daniel, On Tue, Apr 07, 2020 at 09:28:26PM +0200, Daniel Glöckner wrote: > Hello Sascha, > > Am 03/16/20 um 09:04 schrieb Sascha Hauer: > > On Thu, Mar 12, 2020 at 11:36:15PM +0100, Daniel Glöckner wrote: > >> On Thu, Mar 12, 2020 at 09:35:55AM +0100, Sascha Hauer wrote: > >>> This adds a slice to each poller which is acquired before the poller is > >>> executed. This allows us to run pollers inside of other pollers. > >> > >> ok, so in the UDP fastboot case there is now a poller that receives > >> packets and a poller that executes commands and needs packets to > >> be received to send more than one message. How do I make sure that > >> the fastboot poller will never be called inside the net poller since > >> that would cause a deadlock? > [...] > > I wonder if we need some idle slice, a slice that is locked once we are > > outside of some idle loop (shell is waiting for input). In the end the > > fastboot code may only call long running commands when the idle slice is > > not locked. > > RATP has a similar requirement and tries to fulfill it by calling > barebox_ratp_command_run from within readline. I would also like to be > able to run fastboot commands during console_countdown (fb_run_command > already calls console_countdown_abort). > > So how about calling slice_add and the initial slice_acquire for the idle > slice within a pure_initcall and then temporarily dropping the acquired > count inside readline and console_countdown? It should also be temporarily > increased inside poller_call (after checking the poller's slice), > execute_command, and binfmt_run in case someone wants to use the readline > or timeout commands in code called from there. Sounds good. For the fastboot case the incoming commands will never be received in the idle context, so we will have to queue the commands until we can pick them up in the idle context. Well, a "queue" with one entry might be enough already. > > Btw., what are your plans for merging this patch set? Before I merge this series want to have the idle slice issue solved. I don't want to risk merging something that we have to completely restructure soon. Do you have any resources to look into the idle slice? BTW I have just rebased the series on latest master. I already merged some of the patches and there are some small merge conflicts. I'll resend the remaining series in a moment. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox