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

From: Joerg Wunsch <j_at_uriah.heep.sax.de>
Date: Wed, 08 Mar 2023 20:52:27 UTC
As Kyle Evans wrote:

> > 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.

OK, thanks for the analysis.

As adding <sys/lock.h> to dpaa2_mc.c fixes the compile issue, and got
me a complete kernel compilation on arm64, I just committed it that
way.  If someone sees a better way, it's also fine - as it is, it
seemed the least intrusive option to me. (Just affects one file, while
touching <sys/mutex.h> would touch the entire kernel.)

-- 
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)