linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
To: linux-sound@vger.kernel.org
Cc: Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@perex.cz>,
	Pietro Caruso <pietrocaruso50@gmail.com>
Subject: [PATCH v2 5/6] ALSA: emu10k1: fix E-MU dock initialization
Date: Sun, 28 Apr 2024 11:37:15 +0200	[thread overview]
Message-ID: <20240428093716.3198666-6-oswald.buddenhagen@gmx.de> (raw)
In-Reply-To: <20240428093716.3198666-1-oswald.buddenhagen@gmx.de>

A side effect of making the dock monitoring interrupt-driven was that
we'd be very quick to program a freshly connected dock. However, for
unclear reasons, the dock does not work when we do that - despite the
FPGA netlist upload going just fine. We work around this by adding a
delay before programming the dock; for safety, the value is several
times as much as was determined empirically.

Note that a badly timed dock hot-plug would have triggered the problem
even before the referenced commit - but now it would happen 100% instead
of about 3% of the time, thus making it impossible to work around by
re-plugging.

Fixes: fbb64eedf5a3 ("ALSA: emu10k1: make E-MU dock monitoring interrupt-driven")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218584
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
---
 sound/pci/emu10k1/emu10k1_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 1a2905e8672b..8ccc0178360c 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -737,6 +737,12 @@ static void snd_emu1010_load_dock_firmware(struct snd_emu10k1 *emu)
 	u32 tmp, tmp2;
 	int err;
 
+	// The docking events clearly arrive prematurely - while the
+	// Dock's FPGA seems to be successfully programmed, the Dock
+	// fails to initialize subsequently if we don't give it some
+	// time to "warm up" here.
+	msleep(200);
+
 	dev_info(emu->card->dev, "emu1010: Loading Audio Dock Firmware\n");
 	/* Return to Audio Dock programming mode */
 	snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG,
-- 
2.44.0.701.g2cf7baacf3.dirty


  parent reply	other threads:[~2024-04-28  9:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28  9:37 [PATCH v2 0/6] ALSA: emu10k1: fixes related to uploading firmware to the E-MU dock Oswald Buddenhagen
2024-04-28  9:37 ` [PATCH v2 1/6] ALSA: emu10k1: fix E-MU card dock presence monitoring Oswald Buddenhagen
2024-04-28  9:37 ` [PATCH v2 2/6] ALSA: emu10k1: factor out snd_emu1010_load_dock_firmware() Oswald Buddenhagen
2024-04-28  9:37 ` [PATCH v2 3/6] ALSA: emu10k1: move the whole GPIO event handling to the workqueue Oswald Buddenhagen
2024-04-28  9:37 ` [PATCH v2 4/6] ALSA: emu10k1: use mutex for E-MU FPGA access locking Oswald Buddenhagen
2024-04-28  9:37 ` Oswald Buddenhagen [this message]
2024-04-28  9:37 ` [PATCH v2 6/6] ALSA: emu10k1: make E-MU FPGA writes potentially more reliable Oswald Buddenhagen
2024-04-28 18:15 ` [PATCH v2 0/6] ALSA: emu10k1: fixes related to uploading firmware to the E-MU dock Takashi Iwai

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=20240428093716.3198666-6-oswald.buddenhagen@gmx.de \
    --to=oswald.buddenhagen@gmx.de \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pietrocaruso50@gmail.com \
    --cc=tiwai@suse.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).