On Monday 10 July 2006 3:21 pm, Vivek Dharmadhikari wrote:
> David
> 
> I have configured the mailer to wrap after 76 lines. 

You should have tried 76 _columns_ or _characters_ instead;
that didn't improve anything.

> Hope my response is readable now. Please let me know. 

> I said I was expecting two queue heads because I could spot one
> qh with one qtd linked to it as is given below. Note that the
> qhs are dumped after expiry of scsi 30 seconds timer.  

Right, only one _active_ QH, then there's also the ring head which
does not get dumped ...

 
> qh/a1610100 dev2 hs ep1 42002102 40000000 (80008c01 data1 nak4)
>    a1595120 out len=512 02008c80 urb 81612500
> 
> But in the above qh, the H bit in dword1 0x42002102 is off. So
> I was hoping that there would be one more qh with H bit set to
> 1(per ehci spec) and linked to above qh. Is my interpretation
> correct ? 

That was the ring head QH, which gets skipped over by the code
used to dump that list.  You sent it in an earlier message:

> >         qh = ehci->async->qh_next.qh;

The "ehci->async" QH gets skipped, and it's got the H bit set.


> As i see only one qh with H bit off and there are 
> no active or empty qh attached to it, i think the driver
> possibly removed unused/retired qh with H-bit set to 1
> which tends to confuse the host controller. is that possible ?      

I think you're likely the confused entity, because you weren't
dumping the node with the H bit set.


> As regards using bus_to_virt(), thanks for pointing out that it
> is deprecated. But then how to unmap the bus address to virtual
> for qh walkthrough ?  

You don't do that.  You keep a CPU view tree and walk that; the
DMA addresses are only used to stuff fields used by the hardware.

- Dave


> 
> Thanks.
> 
> Regards
> Vivek
> 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of David
> Brownell
> Sent: Saturday, July 08, 2006 10:54 AM
> To: Vivek Dharmadhikari
> Cc: linux-usb-devel@lists.sourceforge.net
> Subject: Re: [linux-usb-devel] decoding qh and qtds
> 
> 
> On Friday 07 July 2006 6:16 pm, Vivek Dharmadhikari wrote:
> > Hello David 
> > 
> > I posted earlier questions regarding the scanning of qhs and is reproduced 
> > below
> 
> Is your mailer not capable of wrapping lines correctly?
> 
> 
> > I used the standard idiom like below to dump all the qh and qtds.
> > 
> >         qh = ehci->async->qh_next.qh;
> >         if(qh)
> >         {
> >                 do {
> >                         dbg_qh ("ehci-hcd",ehci, qh);
> >                         qh = qh->qh_next.qh;
> >                 } while (qh);
> >         }
> > 
> > I do the above after the expiry of 30 seconds scsi timer and i always see 
> > that
> > there is only one queue head in the list where as i was expecting at least 
> > two
> > queue head. 
> 
> And you expected two of them ... why?  From what you had said before,
> only one QH would be active, so that's the only one I'd expect to see.
> 
> 
> > After reading the code, i think only active qh and its associated 
> > qtds are shown. If a qh has no qtd,then above code fragment won't produce 
> > all
> > the qhs. Is this observation correct ?    
> 
> There's always a head, and otherwise the only way an empty qh (no qtds) will
> be scheduled is if it's about to be removed.  An empty qh is shown, but
> it won't have any qtds.
> 
> 
> 
> > Alternately, I tried to dump all the qhs by doing something like below
> > 
> > addr = readl(&ehci->regs->async_next);
> > addr = le32_to_cpu(addr); /* My system is big endian */
> > qh = (struct ehci_qh *)bus_to_virt(addr);
> 
> Two things wrong there.  (a) the low bits of that pointer are
> used as hardware type codes, so you need to mask them off; and
> (b) bus_to_virt() is deprecated for all kinds of good reasons,
> don't use it.
> 
> 
> > dbg_qh ("ehci-hcd",ehci, (struct ehci_qh *)qh);
> > 
> > addr = le32_to_cpu(qh->hw_next);
> > qh = (struct ehci_qh *)bus_to_virt(addr);
> 
> Same things again.
> 
> 
> > dbg_qh ("ehci-hcd",ehci, (struct ehci_qh *)qh);
> > 
> > The dword1 which contains RL,H,Device Address etc fields obtained using 
> > above 
> > code fragment contained wrong values. Obviously i did something wrong 
> > above. 
> 
> What makes you think they are wrong?  That should give you a big clue...
> 
> 
> > What am i missing here ? What is the correct way to dump all qhs either ?
> 
> The correct way is to use the C data structures, and walk them using
> normal CPU virtual addresses.  If you're paranoid, double check them
> as you walk, to make sure the views from the CPU and the controller are
> exactly in sync while you walk the data structures.
> 
> - Dave
> 
> 
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> linux-usb-devel@lists.sourceforge.net
> To unsubscribe, use the last form field at:
> https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
> 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to