On Thu, 23 Mar 2000, Benjamin Herrenschmidt wrote:
> >> which if I understood signals that HC is free to do its stuff by writing
> >> appropriate bits in the cmdStatus register. Then however there is this
> >> code
[It was me who actually wrote that so I'll try to reply]
> My understanding of the Compaq OHCI spec was that if TDs and EDs are
> manipulated correctly (correctly means like it's explained in the spec),
> there's no problem doing that when the controller is active. well, we may
Yes, that's true. What caught my eye in the OHCI spec with respect to
the usb-ohci HCD is this excerpt on page 16:
---
Details of the memory data structures that are processed by the Host
Controller in support of the mechanisms described above are provided in
the remainder of this chapter. Since the structures defined are all in
system memory, the Host Controller Driver has full read-write access to
all portions of the structures. The fields in the structures that are
modified by the Host Controller are noted in the field
descriptions. Fields that are indicated as being written by the Host
Controller may not be modified by system software when the structure
containing that field is on a queue or list that is being processed by the
HC. No hardware interlocks are used to provide exclusion.
---
So the ED/TD lists are being processed after writing to cmdStatus and then
we call ep_link() which proceeds to poke the HC chains.
> have some problems in the code that links/unlinks TDs. Since we are
> working on RAM, we are not sure that the CPU respect ordering of write
> operations and this may cause problems we are encountering.
So on processors which do not guarantee the order of writes we should
insert memory barriers before writing the cmdStatus register because the
writes to TDs and EDs might still not have been done, right? Currently
there's quite a lot of code after the last change to TD in td_fill
and before HC starts processing the transfer lists so I think we are safe
but I'm sure this should be done - atleast for the sake of correctness.
> then at least we know where the problem is. I beleive there would still
> be a hole if the EP is already linked while reaching td_sumit_urb().
Don't think so because then it is already correctly inserted in the
transfer queue lists.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]