All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [RFC PATCH 0/2] ALSA: hda - acomp probe fix for i915
Date: Tue, 06 Oct 2020 14:13:40 +0200	[thread overview]
Message-ID: <s5hpn5v5z7v.wl-tiwai@suse.de> (raw)
In-Reply-To: <20201006113042.471718-1-kai.vehmanen@linux.intel.com>

On Tue, 06 Oct 2020 13:30:40 +0200,
Kai Vehmanen wrote:
> 
> 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

Another option would be to move the completion into the common acomp
helper from i915-specific one.  That is,

- Add bind_complete field into struct drm_audio_component,
  initialize it at snd_hdac_acomp_init()

- Call complete_all(&acomp->bind_complete) at the end of
  hdac_component_master_bind()

- Remove / replace i915's own completion with the hdac's one.
  The i915_init_ops can be dropped.


thanks,

Takashi

  parent reply	other threads:[~2020-10-06 12:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Takashi Iwai [this message]
2020-10-06 12:45   ` [RFC PATCH 0/2] ALSA: hda - acomp probe fix for i915 Takashi Iwai
2020-10-06 14:16     ` Kai Vehmanen

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=s5hpn5v5z7v.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.vehmanen@linux.intel.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.