lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Jan 2021 14:43:17 +0100
From:   Arnd Bergmann <arnd@...nel.org>
To:     Takashi Iwai <tiwai@...e.de>
Cc:     Jaroslav Kysela <perex@...ex.cz>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>, Arnd Bergmann <arnd@...db.de>,
        Takashi Iwai <tiwai@...e.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        Daniel Baluta <daniel.baluta@....com>,
        ALSA Development Mailing List <alsa-devel@...a-project.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        sound-open-firmware@...a-project.org
Subject: Re: [PATCH] ALSA: hda: fix SND_INTEL_DSP_CONFIG dependency

On Mon, Jan 4, 2021 at 4:05 PM Takashi Iwai <tiwai@...e.de> wrote:
> On Mon, 04 Jan 2021 16:00:05 +0100, Jaroslav Kysela wrote:
> >
> > Dne 03. 01. 21 v 14:52 Arnd Bergmann napsal(a):
> > > From: Arnd Bergmann <arnd@...db.de>
> > >
> > > The sof-pci-dev driver fails to link when built into the kernel
> > > and CONFIG_SND_INTEL_DSP_CONFIG is set to =m:
> > >
> > > arm-linux-gnueabi-ld: sound/soc/sof/sof-pci-dev.o: in function `sof_pci_probe':
> > > sof-pci-dev.c:(.text+0x1c): undefined reference to `snd_intel_dsp_driver_probe'
> > >
> > > All other drivers using this interface already use a 'select
> > > SND_INTEL_DSP_CONFIG' statement to force the it to be present, so it
> > > seems reasonable to do the same here.
> > >
> > > The stub implementation in the header makes the problem harder to find,
> > > as it avoids the link error when SND_INTEL_DSP_CONFIG is completely
> > > disabled, without any obvious upsides. Remove these stubs to make it
> > > clearer that the driver is in fact needed here.
> > >
> > > Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code")
> > > Signed-off-by: Arnd Bergmann <arnd@...db.de>
> > > ---
> > >  include/sound/intel-dsp-config.h | 17 -----------------
> > >  sound/soc/sof/Kconfig            |  2 ++
> > >  2 files changed, 2 insertions(+), 17 deletions(-)
> > >
> > > diff --git a/include/sound/intel-dsp-config.h b/include/sound/intel-dsp-config.h
> > > index d4609077c258..94667e870029 100644
> > > --- a/include/sound/intel-dsp-config.h
> > > +++ b/include/sound/intel-dsp-config.h
> > > @@ -18,24 +18,7 @@ enum {
> > >     SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_SOF
> > >  };
> > >
> > > -#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG)
> >
> > The SOF drivers selects the DSP config code only when required (for specific
> > platforms - see sound/soc/sof/intel/Kconfig).
> >
> > It seems that the above if should be modified as:
> >
> > #if IS_BUILDIN(CONFIG_SND_INTEL_DSP_CONFIG) || (defined(MODULE) &&
> > IS_MODULE(CONFIG_SND_INTEL_DSP_CONFIG))
> >
> > So the buildin drivers which do not require the DSP config probe can be
> > compiled without this dependency.
>
> As I wrote in another post, a part of the problem is that SOF PCI and
> ACPI drivers call snd_intel_dsp_driver_probe() unconditionally, even
> if no Intel driver is bound.

Makes sense. Is there an existing Kconfig that could be used to
decide whether the drivers use SND_INTEL_DSP_CONFIG or not?
Could it be part of the device specific driver_data?

According to sof_pci_ids[], all PCI IDs are Intel specific, but I can't
tell which ones need the DSP config.

> So even if changing like the above (or
> better to use IS_REACHABLE() macro) works around the issue, the call
> pattern needs to be reconsidered.

If the callers are fixed to address this, then I would expect the
IS_REACHABLE() or IS_ENABLED() to no longer be needed
either.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ