From: Takashi Iwai <tiwai@suse.de>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: alsa-devel@alsa-project.org,
Takashi Sakamoto <o-takashi@sakamocchi.jp>,
clemens@ladisch.de, ffado-devel@lists.sf.net,
linux1394-devel@lists.sourceforge.net
Subject: Re: [PATCH 49/49] firewire/bebob: Add a workaround for M-Audio special Firewire series
Date: Fri, 30 May 2014 18:24:36 +0200 [thread overview]
Message-ID: <s5hegzbkzej.wl%tiwai@suse.de> (raw)
In-Reply-To: <1398433530-13136-50-git-send-email-o-takashi@sakamocchi.jp>
At Fri, 25 Apr 2014 22:45:30 +0900,
Takashi Sakamoto wrote:
>
> In post commit, a quirk of this firmware about transactions is reported.
> This commit apply a workaround for this quirk.
>
> They often fail transactions due to gap_count mismatch. This state is changed
> by generating bus reset.
>
> The fw_schedule_bus_reset() is an exported symbol in firewire-core. But there
> are no header for public. This commit moves its prototype from
> drivers/firewire/core.h to include/linux/firewire.h.
>
> This mismatch still affects bus management before generating this bus reset.
> It still takes a time to call driver's probe() because transactions are still
> often failed.
>
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Hrm, I should have taken a deeper review. This change was slipped to
my tree without Stefan's ack.
Stefan, is it OK to keep this change as is?
thanks,
Takashi
> ---
> drivers/firewire/core.h | 1 -
> include/linux/firewire.h | 3 +++
> sound/firewire/bebob/bebob.c | 32 ++++++++++++++++++++++++++++----
> sound/firewire/bebob/bebob.h | 1 +
> 4 files changed, 32 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h
> index c98764a..870044e 100644
> --- a/drivers/firewire/core.h
> +++ b/drivers/firewire/core.h
> @@ -118,7 +118,6 @@ int fw_card_add(struct fw_card *card,
> u32 max_receive, u32 link_speed, u64 guid);
> void fw_core_remove_card(struct fw_card *card);
> int fw_compute_block_crc(__be32 *block);
> -void fw_schedule_bus_reset(struct fw_card *card, bool delayed, bool short_reset);
> void fw_schedule_bm_work(struct fw_card *card, unsigned long delay);
>
> /* -cdev */
> diff --git a/include/linux/firewire.h b/include/linux/firewire.h
> index c3683bd..d4b7683 100644
> --- a/include/linux/firewire.h
> +++ b/include/linux/firewire.h
> @@ -367,6 +367,9 @@ static inline int fw_stream_packet_destination_id(int tag, int channel, int sy)
> return tag << 14 | channel << 8 | sy;
> }
>
> +void fw_schedule_bus_reset(struct fw_card *card, bool delayed,
> + bool short_reset);
> +
> struct fw_descriptor {
> struct list_head link;
> size_t length;
> diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c
> index e1dd421..31b96b7 100644
> --- a/sound/firewire/bebob/bebob.c
> +++ b/sound/firewire/bebob/bebob.c
> @@ -247,10 +247,26 @@ bebob_probe(struct fw_unit *unit,
> if (err < 0)
> goto error;
>
> - err = snd_card_register(card);
> - if (err < 0) {
> - snd_bebob_stream_destroy_duplex(bebob);
> - goto error;
> + if (!bebob->maudio_special_quirk) {
> + err = snd_card_register(card);
> + if (err < 0) {
> + snd_bebob_stream_destroy_duplex(bebob);
> + goto error;
> + }
> + } else {
> + /*
> + * This is a workaround. This bus reset seems to have an effect
> + * to make devices correctly handling transactions. Without
> + * this, the devices have gap_count mismatch. This causes much
> + * failure of transaction.
> + *
> + * Just after registration, user-land application receive
> + * signals from dbus and starts I/Os. To avoid I/Os till the
> + * future bus reset, registration is done in next update().
> + */
> + bebob->deferred_registration = true;
> + fw_schedule_bus_reset(fw_parent_device(bebob->unit)->card,
> + false, true);
> }
>
> dev_set_drvdata(&unit->device, bebob);
> @@ -273,6 +289,14 @@ bebob_update(struct fw_unit *unit)
>
> fcp_bus_reset(bebob->unit);
> snd_bebob_stream_update_duplex(bebob);
> +
> + if (bebob->deferred_registration) {
> + if (snd_card_register(bebob->card) < 0) {
> + snd_bebob_stream_destroy_duplex(bebob);
> + snd_card_free(bebob->card);
> + }
> + bebob->deferred_registration = false;
> + }
> }
>
> static void bebob_remove(struct fw_unit *unit)
> diff --git a/sound/firewire/bebob/bebob.h b/sound/firewire/bebob/bebob.h
> index 4a54e74..91b26b0 100644
> --- a/sound/firewire/bebob/bebob.h
> +++ b/sound/firewire/bebob/bebob.h
> @@ -109,6 +109,7 @@ struct snd_bebob {
>
> /* for M-Audio special devices */
> void *maudio_special_quirk;
> + bool deferred_registration;
> };
>
> static inline int
> --
> 1.8.3.2
>
next prev parent reply other threads:[~2014-05-30 16:24 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-25 13:44 [PATCH 00/49 v4] Enhancement for support of Firewire devices Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 01/49] firewire-lib: Rename functions, structure, member for AMDTP Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 02/49] firewire-lib: Add macros instead of fixed value " Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 03/49] firewire-lib: Add 'direction' member to 'amdtp_stream' structure Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 04/49] firewire-lib: Split some codes into functions to reuse for both streams Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 05/49] firewire-lib: Add support for AMDTP in-stream and PCM capture Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 06/49] firewire-lib: Add support for MIDI capture/playback Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 07/49] firewire-lib: Give syt value as parameter to handle_out_packet() Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 08/49] firewire-lib: Add support for duplex streams synchronization in blocking mode Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 09/49] firewire-lib: Add support for channel mapping Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 10/49] dice/firewire-lib: Keep dualwire mode but obsolete CIP_HI_DUALWIRE Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 11/49] firewire-lib/dice/speakers: Add common PCM constraints for AMDTP streams Takashi Sakamoto
2014-05-26 12:34 ` Takashi Iwai
2014-04-25 13:44 ` [PATCH 12/49] firewire-lib: Restrict calling flush_context_completion() when context exists Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 13/49] firewire-lib: Rename macros, variables and functions for CMP Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 14/49] firewire-lib: Add 'direction' member to 'cmp_connection' structure Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 15/49] firewire-lib: Add handling output connection by CMP Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 16/49] firewire-lib: Add a new function to check others' connection Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 17/49] firewire-lib: Add support for deferred transaction Takashi Sakamoto
2014-04-25 13:44 ` [PATCH 18/49] firewire-lib: Add some AV/C general commands Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 19/49] fireworks: Add skelton for Fireworks based devices Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 20/49] fireworks: Add transaction and some commands Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 21/49] fireworks: Add connection and stream management Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 22/49] fireworks/firewire-lib: Add a quirk for empty packet with TAG0 Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 23/49] fireworks/firewire-lib: Add a quirk for the meaning of dbc Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 24/49] fireworks/firewire-lib: Add a quirk for wrong dbs in tx packets Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 25/49] fireworks/firewire-lib: Add a quirk for fixed interval of reported dbc Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 26/49] fireworks/firewire-lib: Add a quirk to reset data block counter at bus reset Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 27/49] fireworks: Add proc interface for debugging purpose Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 28/49] fireworks: Add MIDI interface Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 29/49] fireworks/firewire-lib: Add a quirk of data blocks for MIDI in out-stream Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 30/49] fireworks: Add PCM interface Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 31/49] fireworks: Add hwdep interface Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 32/49] fireworks: Add command/response functionality into " Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 33/49] bebob: Add skelton for BeBoB based devices Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 34/49] bebob: Add commands and connections/streams management Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 35/49] bebob/firewire-lib: Add a quirk for discontinuity at bus reset Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 36/49] bebob: Add proc interface for debugging purpose Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 37/49] bebob: Add MIDI interface Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 38/49] bebob: Add PCM interface Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 39/49] bebob: Add hwdep interface Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 40/49] bebob: Prepare for device specific operations Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 41/49] bebob: Add support for Terratec PHASE, EWS series and Aureon Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 42/49] bebob: Add support for Yamaha GO series Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 43/49] bebob: Add support for Focusrite Saffire/SaffirePro series Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 44/49] bebob: Add support for M-Audio usual Firewire series Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 45/49] bebob: Add support for M-Audio special " Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 46/49] bebob/firewire-lib: Add a quirk of wrong dbc in empty packet " Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 47/49] bebob: Add a quirk of data blocks for MIDI messages for some M-Audio devices Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 48/49] bebob: Send a cue to load firmware for M-Audio Firewire series Takashi Sakamoto
2014-04-25 13:45 ` [PATCH 49/49] firewire/bebob: Add a workaround for M-Audio special " Takashi Sakamoto
2014-05-30 16:24 ` Takashi Iwai [this message]
2014-05-30 20:22 ` Stefan Richter
2014-05-31 5:56 ` Takashi Iwai
2014-04-25 22:58 ` A Restriction and rest of issues for this patchsets Takashi Sakamoto
2014-04-29 11:21 ` [PATCH 00/49 v4] Enhancement for support of Firewire devices Takashi Sakamoto
2014-05-25 5:55 ` Takashi Sakamoto
2014-05-26 8:41 ` Clemens Ladisch
2014-05-26 8:55 ` Takashi Iwai
2014-05-26 12:38 ` [alsa-devel] " Takashi Iwai
2014-05-26 22:45 ` Takashi Sakamoto
2014-05-27 4:13 ` Takashi Sakamoto
2014-05-27 5:35 ` Takashi Iwai
2014-05-27 5:20 ` Takashi Iwai
2014-05-27 5:30 ` Takashi Sakamoto
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=s5hegzbkzej.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 \
--cc=stefanr@s5r6.in-berlin.de \
/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