Adding movable PCIe BARs support in snd_hda_intel

Takashi Iwai tiwai at suse.de
Wed Mar 24 11:00:12 CET 2021


On Tue, 23 Mar 2021 19:25:53 +0100,
Andrey Grodzovsky wrote:
> 
> >> This will cover IOCTLs and any
> >> mmapped accesses i guess. Interrupts we discussed above. What above any
> >> possible background kernel work going on in dedicated threads or work
> >> items ? Any pointers there what should be blocked and waited for ?
> >
> > An alternative idea would be the analogy of the system suspend /
> > resume.  That is, we forcibly suspend the devices at first somehow,
> > and also restricts the further accesses by some way.  Then do remap,
> 
> But that the point I guess, how you block further accesses without those
> big locks, during S3 i believe user mode gets suspended before the
> driver and so you don't need to worry about concurrent IOCTLs when going
> through suspend sequence

ALSA core still has some legacy card-level power management code,
which was introduced many years ago at the time we still managed the
power state via an extra ioctl (hence working individually from the
base PM code), and a few pieces are still effective for this kind of
purposes.  Through a quick glance, a couple of places need band-aids,
but the rest should work.

A bit more difficult problem is the floating control API calls.  The
get/put calls might be still in flight when we perform the PCI
rescan.  This has to be filtered out additionally.

Below are a patch series I cooked quickly.  Totally untested, just
checked the compilation.  The first patch is a fix I'll merge in
anyway, while the rest are RFC.


thanks,

Takashi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ALSA-hda-Re-add-dropped-snd_poewr_change_state-calls.patch
Type: application/octet-stream
Size: 1411 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210324/ea4ec7c5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ALSA-control-Add-power-state-check-commonly-for-ioct.patch
Type: application/octet-stream
Size: 1140 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210324/ea4ec7c5/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-ALSA-control-Drop-superfluous-snd_power_wait-calls.patch
Type: application/octet-stream
Size: 1627 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210324/ea4ec7c5/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-ALSA-control-Minor-optimization-for-SNDRV_CTL_IOCTL_.patch
Type: application/octet-stream
Size: 1066 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210324/ea4ec7c5/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-ALSA-pcm-Block-the-release-until-the-system-resume-f.patch
Type: application/octet-stream
Size: 1156 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210324/ea4ec7c5/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-ALSA-hda-Add-frozen-flag-for-prohibiting-hardware-ac.patch
Type: application/octet-stream
Size: 2350 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210324/ea4ec7c5/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-ALSA-hda-Add-support-for-BARs-move-on-PCI-rescan.patch
Type: application/octet-stream
Size: 5351 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20210324/ea4ec7c5/attachment-0006.obj>


More information about the Alsa-devel mailing list