Re: some question about ehci-sched.c
hi Alan: > We don't _have_ to do it. It is a small optimization; an attempt to > avoid schedule collisions between interrupt transactions and > isochronous transactions. The effect of the "-" is that the code tries > frames in backward order when it is scheduling isochronous URBs -- as > opposed to trying frames in forward order when scheduling periodic > URBs. appreciate ur kind explanation.
Re: some question about ehci-sched.c
On Fri, 21 Sep 2018, yoma sophian wrote: > hi all: > in iso_stream_schedule of ehci-sched.c, why we have to add the "-" in > (-(++ehci->random_frame)) to calculate the start uframe? > thanks for ur help in advance. > > if (stream->ps.phase == NO_FRAME) { > int done = 0; > struct ehci_tt *tt = find_tt(stream->ps.udev); > > if (IS_ERR(tt)) { > status = PTR_ERR(tt); > goto fail; > } > compute_tt_budget(ehci->tt_budget, tt); > > start = ((-(++ehci->random_frame)) << 3) & (period - > 1); > ^^ Here it is. We don't _have_ to do it. It is a small optimization; an attempt to avoid schedule collisions between interrupt transactions and isochronous transactions. The effect of the "-" is that the code tries frames in backward order when it is scheduling isochronous URBs -- as opposed to trying frames in forward order when scheduling periodic URBs. It isn't important. Alan Stern
some question about ehci-sched.c
hi all: in iso_stream_schedule of ehci-sched.c, why we have to add the "-" in (-(++ehci->random_frame)) to calculate the start uframe? thanks for ur help in advance. if (stream->ps.phase == NO_FRAME) { int done = 0; struct ehci_tt *tt = find_tt(stream->ps.udev); if (IS_ERR(tt)) { status = PTR_ERR(tt); goto fail; } compute_tt_budget(ehci->tt_budget, tt); start = ((-(++ehci->random_frame)) << 3) & (period - 1); ^^ Here it is.