> Date: Mon, 12 Jul 2021 11:56:28 +1000
> From: Jonathan Gray <j...@jsg.id.au>
> 
> On Sun, Jul 11, 2021 at 05:55:14PM +0200, Marcus Glocker wrote:
> > dwctwo(4) on the Raspberry Pi 3 has some issues today.  Basically uhub2
> > doesn't work which shows in:
> > 
> >     - mue(4) doesn't attach on uhub2 port 1.
> >     - Removable devices don't attach on uhub2 port 2 and 3.
> 
> on the 3b+ you mean, smsc(4) is fine on the 3b
> 
> > 
> > On NetBSD this works fine, but looking for specific fixes in the NetBSD
> > code base shows quickly that we have grown a big gap between both code
> > bases.  This makes syncing back specific fixes, if you can identify them
> > at all, very difficult, if not impossible.
> > 
> > Therefore I took the path of syncing the entire NetBSD code base with
> > ours.  This fixes the above issues on my Raspberry Pi 3 which is kind
> > of nice, especially since we can use the integrated mue(4) Ethernet
> > controller by default now.
> > 
> > I decided to keep the list_* queue macros from Linux, and use the Linux
> > headers which are already included in our code base for drm(4).  This
> > just makes future syncing easier.
> 
> You should not do this.  They exist because there are millions of
> lines of rapidly changing code in drm and only have the barest of what
> is required for drm.  dwc2 is quite small in comparison and I'm sure
> there are still problems in the drm replacement linux functions.

When I looked at the dwc2 code in the past I learned that replacing
the Linux list APIs with the interfaces from <sys/queue.h> is not
trivial.  IMHO the Linux list APIs are rather dangerous as they make
doing list validation almost impossible but they allow some operations
that the BSD interfaces don't implement.  So I think switching back to
the Linux APIs in this codebase makes sense.  But the code should
probably use its own copy of those interfaces to avoid any unwanted
interaction with future drm updates as Linux really doesn't have
stable APIs.

Reply via email to