All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] ALSA: hda - acomp probe fix for i915
@ 2020-10-06 11:30 Kai Vehmanen
  2020-10-06 11:30 ` [RFC PATCH 1/2] ALSA: hda - keep track of HDA core bus instance in acomp Kai Vehmanen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kai Vehmanen @ 2020-10-06 11:30 UTC (permalink / raw)
  To: alsa-devel, tiwai; +Cc: Kai Vehmanen

Hi,

this simple bugfix started to feel a bit like getting stuck in quicksand,
so I'm looking for some early input via this RFC series.

Basicly hdac_i915.c should not use global state to track communication
with i915 driver. But how to get handle of "hdac_bus*? I considered
a few options:

  1) add hdac_bus as a member of drm_audio_component.h
	-> seems wrong as this is really an audio side implementation)

  2) embed copy of drm_audio_component to 'struct hdac_bus', so
     I could use container_of() on the device handle to get
     to the bus 
	-> wasted space to keep a copy at hdac_bus level
	   (note: snd-hda-codec-hdmi do this by embedding a copy
	    of ops to "struct hdmi_spec")

  3) add another devres entry to store the hdac_bus directly
     in acomp_init and a new helper function to query it

I now implemented option 3 in this RFC series as it seemed cleanest
and most local to hdac_component.c, where the problem stems from. It's still
somewhat messy, and I'm wondering if I'm overlooking some obvious alternative.
We could dig this deeper into i915 specific code, but OTOH, hdac_bus is
an argument snd_hdac_acomp_init(), so it's common for all.

Kai Vehmanen (2):
  ALSA: hda - keep track of HDA core bus instance in acomp
  ALSA: hda/i915 - fix list corruption with concurrent probes

 include/sound/hda_component.h |  5 +++++
 include/sound/hdaudio.h       |  2 ++
 sound/hda/hdac_component.c    | 34 ++++++++++++++++++++++++++++++++++
 sound/hda/hdac_i915.c         | 16 +++++++++-------
 4 files changed, 50 insertions(+), 7 deletions(-)

-- 
2.28.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-06 14:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 11:30 [RFC PATCH 0/2] ALSA: hda - acomp probe fix for i915 Kai Vehmanen
2020-10-06 11:30 ` [RFC PATCH 1/2] ALSA: hda - keep track of HDA core bus instance in acomp Kai Vehmanen
2020-10-06 11:30 ` [RFC PATCH 2/2] ALSA: hda/i915 - fix list corruption with concurrent probes Kai Vehmanen
2020-10-06 12:13 ` [RFC PATCH 0/2] ALSA: hda - acomp probe fix for i915 Takashi Iwai
2020-10-06 12:45   ` Takashi Iwai
2020-10-06 14:16     ` Kai Vehmanen

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.