All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: Mark Jonas <toertel@gmail.com>
Cc: openembedded-core@lists.openembedded.org,
	michael.opdenacker@bootlin.com,
	 richard.purdie@linuxfoundation.org
Subject: Re: [OE-core] [PATCH 2/2] linux-yocto: Autoload sound driver on QEMU x86
Date: Thu, 5 Jan 2023 09:57:38 -0500	[thread overview]
Message-ID: <CADkTA4NhVxONZONVWd9yP4g735Mr5cVThLPcWRUv0vBYkXmc3A@mail.gmail.com> (raw)
In-Reply-To: <CAEE5dN1jL4KYpYMz9En=NqiEE-Bu8HsCXhTSUgECekktmjr78A@mail.gmail.com>

On Thu, Jan 5, 2023 at 8:42 AM Mark Jonas <toertel@gmail.com> wrote:
>
> Hi Bruce,
>
> On Wed, Jan 4, 2023 at 5:07 PM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> >
> > On Wed, Jan 4, 2023 at 7:18 AM Mark Jonas <toertel@gmail.com> wrote:
> > >
> > > From: Mark Jonas <toertel@gmail.com>
> > >
> > > If DISTRO_FEATURES includes ALSA then automatically load the
> > > snd-intel8x0 kernel module on qemux86 and qemux86-64. This matches the
> > > machine configurations conf/machine/qemux86.conf and qemux86-64.conf.
> > >
> > > Signed-off-by: Mark Jonas <toertel@gmail.com>
> > > ---
> > >  meta/recipes-kernel/linux/linux-yocto.inc | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
> > > index 091003ed82..c8a9b0a1e3 100644
> > > --- a/meta/recipes-kernel/linux/linux-yocto.inc
> > > +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> > > @@ -37,6 +37,11 @@ KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/
> > >  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
> > >  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
> > >
> > > +# sound driver recommended by conf/machine/qemux86*.conf
> > > +ALSA_MODULES = "${@bb.utils.contains("DISTRO_FEATURES", "alsa", "snd-intel8x0", "", d)}"
> > > +KERNEL_MODULE_AUTOLOAD:qemux86 += "${ALSA_MODULES}"
> > > +KERNEL_MODULE_AUTOLOAD:qemux86-64 += "${ALSA_MODULES}"
> >
> > This gets us most of the way, but if we are going to do this we should
> > complete the job.
> >
> > We really need to make sure there's a configuration fragment that
> > explicitly enables
> > the modules we need (and not count on defaults, or other selects). That would go
> > into the kernel-cache.
> >
> > It would then be something we'd add to the KERNEL_FEATRES triggered off the
> > distro feature. Just like we are doing with numa and vfat that is visible in the
> > context of the patch.
>
> In my understanding this is already the case. See for example
> linux-yocto_5.19.bb which contains the following lines.
>
> KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
> KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
>
> Does that maybe mean I should better add the KERNEL_MODULE_AUTOLOAD
> into the same file where the corresponding configuration fragment is
> added? But that would mean to duplicate the lines over five recipes.
>
> Alternatively I could move the cfg/sound.scc out of the recipes into
> the linux-yocto.inc. But then linux-yocto-tiny_*.bb recipes would also
> get it.

I definitely wasn't clear. Sorry about that, I'm still partially on
holidays and didn't have enough coffee when I wrote that.

That is close to what I meant. It is one thing to define the options
in our generic sound "buckets" and another to put a specific module
into the autoload.

If we are going to autoload a module, the option really should be
pulled out of the generic bucket, and put into something smaller /
specific to what we are trying to do, and trigger the inclusion of
that fragment only when the appropriate distro feature is set. The
machine conf files specifying specific modules isn't ideal, since it
is largely "aspirational" unless it is coupled with a KERNEL_FEATURE
that is set based on a machine or distro feature.

If you search the mailing list archives, you'll see me musing about
how I need to change those unconditional appends of option to qemu, as
it makes defining a new qemu machine problematic (if the options are
causing issues). The tweak I'm describing is a small step in that
direction.

One new question comes to mind, what init system were you testing with
(default poky and sysvinit ?) ? If we now have the proper init system,
are no events being triggered to load the modules now that the proper
ones are in the machine files ?

Bruce

>
> Cheers,
> Mark







--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


  reply	other threads:[~2023-01-05 14:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 12:18 [PATCH 0/2] Load proper sound drivers for QEMU x86 toertel
2023-01-04 12:18 ` [PATCH 1/2] conf/machine: Match QEMU x86 sound kernel module toertel
2023-01-04 12:18 ` [PATCH 2/2] linux-yocto: Autoload sound driver on QEMU x86 toertel
2023-01-04 16:07   ` [OE-core] " Bruce Ashfield
2023-01-05 13:42     ` Mark Jonas
2023-01-05 14:57       ` Bruce Ashfield [this message]
2023-01-06 10:13         ` Mark Jonas
2023-01-06 11:27           ` Richard Purdie
2023-01-06 15:05             ` Mark Jonas
2023-01-06 16:33               ` Bruce Ashfield
2023-01-06 16:15             ` Bruce Ashfield
2023-01-06 16:00           ` Bruce Ashfield
2023-01-04 17:42 ` [PATCH 0/2] Load proper sound drivers for " Richard Purdie
2023-01-05 17:26   ` Mark Jonas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADkTA4NhVxONZONVWd9yP4g735Mr5cVThLPcWRUv0vBYkXmc3A@mail.gmail.com \
    --to=bruce.ashfield@gmail.com \
    --cc=michael.opdenacker@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=toertel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.