[9fans] Tdmaxpkt in usbehci

2013-04-11 Thread kernel panic

in the ehci driver, it uses:

 

Tdmaxpkt = 0x5000, /* max buffer for a Td */

 

a td has 5*4K pages giving the 20K above, but i think this only applies if the
first pointer is page aligned (page offset = 0) so all the pages can be filled
completely.

 

The EHCI spec says this:
"The buffer pointer list in the qTD is long enough to support a maximum transfer size of 20K bytes. This case
occurs when all five buffer pointers are used and the first offset is zero. A qTD handles a 16Kbyte buffer
with any starting buffer alignment."

 

The buffer pointer isnt page aligned as far as i can see, so make Tdmaxpkt = 0x4000 instead?

 

--
cinap

 


 



[9fans] Tdmaxpkt in usbehci (no html)

2013-04-11 Thread cinap_lenrek
in the ehci driver, it uses:
 
Tdmaxpkt = 0x5000, /* max buffer for a Td */
 
a td has 5*4K pages giving the 20K above, but i think this only applies if the
first pointer is page aligned (page offset = 0) so all the pages can be filled
completely.
 
The EHCI spec says this:
"The buffer pointer list in the qTD is long enough to support a maximum 
transfer size of 20K bytes. This case
occurs when all five buffer pointers are used and the first offset is zero. A 
qTD handles a 16Kbyte buffer
with any starting buffer alignment."
 
The buffer pointer isnt page aligned as far as i can see, so make Tdmaxpkt = 
0x4000 instead?
 
--
cinap
 
PS:
sorry for the previous mail. i was sending it with web mail which i use very 
rarely
and the default setting for email was to send them as HTML :(



[9fans] International Ispell in Plan9

2013-04-11 Thread trebol
> And you can have '>> /personal/dictionary/path' [...]

Sorry, this must be 'echo >> /personal/dictionary/path' and make a 2-1 mouse
chord.

Regards,
trebol.



Re: [9fans] Tdmaxpkt in usbehci (no html)

2013-04-11 Thread erik quanstrom
> in the ehci driver, it uses:
>  
> Tdmaxpkt = 0x5000, /* max buffer for a Td */
>  
> a td has 5*4K pages giving the 20K above, but i think this only applies if the
> first pointer is page aligned (page offset = 0) so all the pages can be filled
> completely.
>  
> The EHCI spec says this:
> "The buffer pointer list in the qTD is long enough to support a maximum 
> transfer size of 20K bytes. This case
> occurs when all five buffer pointers are used and the first offset is zero. A 
> qTD handles a 16Kbyte buffer
> with any starting buffer alignment."
>  
> The buffer pointer isnt page aligned as far as i can see, so make Tdmaxpkt = 
> 0x4000 instead?

i wonder if it would make more sense to align the buffer.

(the unaligned case for iso->data looks wierd, too.)

- erik



Re: [9fans] Tdmaxpkt in usbehci (no html)

2013-04-11 Thread kernel panic
yes, that would work too.

--
cinap

> Gesendet: Donnerstag, 11. April 2013 um 15:05 Uhr
> Von: "erik quanstrom" 
> An: 9fans@9fans.net
> Betreff: Re: [9fans] Tdmaxpkt in usbehci (no html)
>
> > in the ehci driver, it uses:
> >  
> > Tdmaxpkt = 0x5000, /* max buffer for a Td */
> >  
> > a td has 5*4K pages giving the 20K above, but i think this only applies if 
> > the
> > first pointer is page aligned (page offset = 0) so all the pages can be 
> > filled
> > completely.
> >  
> > The EHCI spec says this:
> > "The buffer pointer list in the qTD is long enough to support a maximum 
> > transfer size of 20K bytes. This case
> > occurs when all five buffer pointers are used and the first offset is zero. 
> > A qTD handles a 16Kbyte buffer
> > with any starting buffer alignment."
> >  
> > The buffer pointer isnt page aligned as far as i can see, so make Tdmaxpkt 
> > = 0x4000 instead?
> 
> i wonder if it would make more sense to align the buffer.
> 
> (the unaligned case for iso->data looks wierd, too.)
> 
> - erik
> 
> 



[9fans] wired loop in usbehci / isohsinit()

2013-04-11 Thread kernel panic
this td->buffer[i] access makes no sense.

static void
isohsinit(Ep *ep, Isoio *iso)
{
int ival, p;
long left;
ulong frno, i, pa;
Itd *ltd, *td;

iso->hs = 1;
ival = 1;
if(ep->pollival > 8)
ival = ep->pollival/8;
left = 0;
ltd = nil;
frno = iso->td0frno;
for(i = 0; i < iso->nframes; i++){
td = itdalloc();
td->data = iso->data + i * 8 * iso->maxsize;
pa = PADDR(td->data) & ~0xFFF;
for(p = 0; p < 8; p++)
td->buffer[i] = pa + p * 0x1000;   // <- HERE
td->buffer[0] = PADDR(iso->data) & ~0xFFF |
ep->nb << Itdepshift | ep->dev->nb << Itddevshift;
if(ep->mode == OREAD)
td->buffer[1] |= Itdin;
else
td->buffer[1] |= Itdout;
td->buffer[1] |= ep->maxpkt << Itdmaxpktshift;
td->buffer[2] |= ep->ntds << Itdntdsshift;

if(ep->mode == OREAD)
td->mdata = 8 * iso->maxsize;
else{
td->mdata = (ep->hz + left) * ep->pollival / 1000;
td->mdata *= ep->samplesz;
left = (ep->hz + left) * ep->pollival % 1000;
}
coherence();
iso->itdps[frno] = td;
coherence();
itdinit(iso, td);
if(ltd != nil)
ltd->next = td;
ltd = td;
frno = TRUNC(frno + ival, Nisoframes);
}
}

--
cinap



Re: [9fans] International Ispell in Plan9

2013-04-11 Thread Nemo
you could put it in sources, if not yet there.