Re: git: 175a584e501e - main - usb: dwc3: add <sys/mutex.h>

From: Kyle Evans <kevans_at_freebsd.org>
Date: Wed, 08 Mar 2023 20:45:17 UTC
On Wed, Mar 8, 2023 at 2:24 PM Joerg Wunsch <j@uriah.heep.sax.de> wrote:
>
> As Kyle Evans wrote:
>
> > >     Commit 5e54bb1ea9e90 added USB_BUS_LOCK/USB_BUS_UNLOCK. They, in
> > >     consequence, require mutexes so <sys/mutex.h> is needed.
> >
> > Whoops, thanks!
>
> You're welcome.
>
> I'm just trying to compile a current kernel on a RockPi 4 (arm64), and
> it broke.
>
> While the reason for this one was rather obvious, the second breakage
> though is more of a mystery to me:
>
> sys/dev/dpaa2/dpaa2_mc.c fails to compile since LA_UNLOCKED is
> undefined. This is aliased to MA_NOTOWNED in <sys/mutex.h>.
>
> Sure, I can get it to compile by adding <sys/lock.h> to that file, but
> I don't see why it could ever compile at all.  OTOH, wouldn't it make
> sense that <sys/mutex.h> itself included <sys/lock.h>?
>

It looks like it's getting it via pollution from ACPI headers or from
sys/mutex.h -> sys/lock_profiling.h -> sys/lock.h with LOCK_PROFILING
enabling.

It would make sense, but we've only semi-recently started considering
making headers self-contained.

Thanks,

Kyle Evans