Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: alsa-devel@alsa-project.org,
	linux1394-devel@lists.sourceforge.net, clemens@ladisch.de,
	ffado-devel@lists.sf.net
Subject: Re: [PATCH 0/4] ALSA: fireworks/bebob/dice/oxfw: fix kernel oops at unplugging during streaming
Date: Mon, 23 Feb 2015 09:18:27 +0100	[thread overview]
Message-ID: <s5h7fv911nw.wl-tiwai@suse.de> (raw)
In-Reply-To: <1424530500-9116-1-git-send-email-o-takashi@sakamocchi.jp>

At Sat, 21 Feb 2015 23:54:56 +0900,
Takashi Sakamoto wrote:
> 
> Each FireWire sound driver causes kernel oops at unplugging during
> streaming. This bug affects:
>  - snd-bebob (in 3.16 or later)
>  - snd-fireworks (in 3.16 or later)
>  - snd-dice (in 3.19 or later)
>  - snd-oxfw (in 3.19 or later)
> 
> When streaming, any ALSA character devices are opened and sound card
> object is referred. Then 'struct snd_card.private_free()' is not executed
> in a context of 'struct fw_driver.remove()'. It's executed in a context of
> an application process in which the last ALSA character device is closed.
> In this case, any operation to instances of FireWire unit is invalid
> because it's already released, and causes kernel oops. I confirm GPF or
> Null-pointer-dereference.
> 
> To fix this problem, this patchset do:
> 1.delegate reference counting of an instance of FireWire unit from AMDTP
>   helper functions to each driver, then do it in
>   'struct snd_card.private_free()'.
> 2.move stream or transaction destructor from 'struct fw_driver.remove()'
>   to 'struct snd_card.private_free()'.
> 
> With this patchset, each driver keeps a reference to FireWire unit till
> all of ALSA applications close its character devices. This may be against
> IEEE 1394 bus driver developers' expectation to high-level drivers.

Thanks, now applied all four patches.


Takashi

> 
> Takashi Sakamoto (4):
>   ALSA: fireworks/bebob/dice/oxfw: add reference-counting for FireWire
>     unit
>   ALSA: firewire-lib: remove reference counting
>   ALSA: fireworks/bebob/dice/oxfw: allow stream destructor after
>     releasing runtime
>   ALSA: fireworks/bebob/dice/oxfw: make it possible to shutdown safely
> 
>  sound/firewire/amdtp.c                      |  3 +--
>  sound/firewire/bebob/bebob.c                | 20 ++++++++++++++++----
>  sound/firewire/bebob/bebob_stream.c         | 16 ++++------------
>  sound/firewire/dice/dice-stream.c           | 18 ++++++++++++------
>  sound/firewire/dice/dice.c                  | 16 +++++++++++-----
>  sound/firewire/fireworks/fireworks.c        | 20 ++++++++++++++------
>  sound/firewire/fireworks/fireworks_stream.c | 19 ++++++++++---------
>  sound/firewire/oxfw/oxfw-stream.c           |  6 ++++--
>  sound/firewire/oxfw/oxfw.c                  | 21 ++++++++++++++-------
>  9 files changed, 86 insertions(+), 53 deletions(-)
> 
> -- 
> 2.1.0
> 

      parent reply	other threads:[~2015-02-23  8:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-21 14:54 [PATCH 0/4] ALSA: fireworks/bebob/dice/oxfw: fix kernel oops at unplugging during streaming Takashi Sakamoto
2015-02-21 14:54 ` [PATCH 1/4] ALSA: fireworks/bebob/dice/oxfw: add reference-counting for FireWire unit Takashi Sakamoto
2015-02-21 14:54 ` [PATCH 2/4] ALSA: firewire-lib: remove reference counting Takashi Sakamoto
2015-02-21 14:54 ` [PATCH 3/4] ALSA: fireworks/bebob/dice/oxfw: allow stream destructor after releasing runtime Takashi Sakamoto
2015-02-21 14:55 ` [PATCH 4/4] ALSA: fireworks/bebob/dice/oxfw: make it possible to shutdown safely Takashi Sakamoto
2015-02-21 23:06 ` [PATCH 0/4] ALSA: fireworks/bebob/dice/oxfw: fix kernel oops at unplugging during streaming Clemens Ladisch
2015-02-22 17:36   ` Takashi Iwai
2015-02-22 18:49     ` Clemens Ladisch
2015-02-23  8:18 ` Takashi Iwai [this message]

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=s5h7fv911nw.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=ffado-devel@lists.sf.net \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=o-takashi@sakamocchi.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox