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]
Message-ID: <244b3030-0d24-300f-354d-46878b708056@linux.intel.com>
Date:   Wed, 18 Aug 2021 13:09:44 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     alsa-devel@...a-project.org,
        "Rafael J . Wysocki" <rafael@...nel.org>, tiwai@...e.de,
        linux-kernel@...r.kernel.org, liam.r.girdwood@...ux.intel.com,
        vkoul@...nel.org, Mark Brown <broonie@...nel.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Jason Gunthorpe <jgg@...dia.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Christoph Hellwig <hch@....de>
Subject: Re: [RFC PATCH 1/2] driver core: export
 driver_deferred_probe_trigger()


>>>> a) we have to use request_module()
>>>
>>> Wait, why?
>>>
>>> module loading is async, use auto-loading when the hardware/device is
>>> found and reported to userspace.  Forcing a module to load by the kernel
>>> is not always wise as the module is not always present in the filesystem
>>> at that point in time at boot (think modules on the filesystem, not in
>>> the initramfs).
>>>
>>> Try fixing this issue and maybe it will resolve itself as you should be
>>> working async.
>>
>> It's been that way for a very long time (2015?) for HDAudio support, see
>> sound/pci/hda/hda_bind.c. It's my understanding that it was a conscious
>> design decision to use vendor-specific modules, if available, and
>> fallback to generic modules if the first pass failed.
> 
> If it has been this way for so long, what has caused the sudden change
> to need to export this and call this function?

Fair question, I did not provide all the context with a cover letter
that was already quite long. Here are more details:

In the existing Intel audio drivers, we have a PCI device that first get
probed. The PCI driver initializes the DSP and exposes what the audio
DSP can do, but the platform-specific configuration for a given board is
handled by a child device [1]. We have all kinds of hard-coded lookup
tables to figure out what the board is and what machine driver should be
used based on the presence of other ACPI devices and/or DMI quirks
[2][3]. We must have used this solution since 2010, mainly because 'the
other OS' does not rely on platform firmware for a description of the
audio capabilities.

In the 'soon' future, that machine driver will probed with its own ACPI
ID and become generic, with all the information related to the board
described in platform firmware and parsed by the driver. This is how the
'simple card' works today in Device Tree environments, platform firmware
describes how host-provided components are connected to 3rd-party
components. I cannot provide more details at this time since this is a
not yet a publicly-available specification (this specification work does
take place in a standardization body).

That change in how the machine driver gets probed creates a new problem
we didn't have before: this generic machine driver will probe in the
early stages of the boot, long before the DSP and audio codecs are
initialized/available.

I initially looked at the component framework to try to express
dependencies. It's really not clear to me if this is the 'right'
direction, for ASoC-based solutions we already have components that
register with a core.

I also started looking at other proposals that were made over the years,
this problem of expressing dependencies is not new. No real luck.

In the end, since the DeviceTree-based solutions based on deferred
probes work fine for the same type of usages, I tried to reuse the same
deferred probe mechanism. The only reason why I needed to export this
function is to work-around the request_module() use.

I am not claiming any award for architecture, this is clearly a
domain-specific corner case. I did try the async probe, I consulted with
Marc Brown, had an internal review with Dan Williams and Andy
Shevchenko. While nobody cheered, it seemed like this export was
'reasonable' compared to a re-architecture of the HDaudio/HDMI support -
which is a really scary proposition.

There is no immediate rush to make this change in this kernel cycle or
the next, I am open to alternatives, but I wanted to make sure we don't
have any Linux plumbing issues by the time the specification becomes
public and is used by 'the other OS'.

Does this help get more context?

[1] https://elixir.bootlin.com/linux/latest/source/sound/soc/sof/core.c#L234

[2]
https://elixir.bootlin.com/linux/latest/source/sound/soc/intel/common/soc-acpi-intel-tgl-match.c#L323

[3]
https://elixir.bootlin.com/linux/latest/source/sound/soc/intel/boards/sof_sdw.c#L50




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ