Skip to content

Commit 9b84f0f

Browse files
takaswietiwai
authored andcommitted
ALSA: dice: fix regression for Lexicon I-ONIX FW810S
For Lexicon I-ONIX FW810S, the call of ioctl(2) with SNDRV_PCM_IOCTL_HW_PARAMS can returns -ETIMEDOUT. This is a regression due to the commit 41319eb ("ALSA: dice: wait just for NOTIFY_CLOCK_ACCEPTED after GLOBAL_CLOCK_SELECT operation"). The device does not emit NOTIFY_CLOCK_ACCEPTED notification when accepting GLOBAL_CLOCK_SELECT operation with the same parameters as current ones. This commit fixes the regression. When receiving no notification, return -ETIMEDOUT as long as operating for any change. Fixes: 41319eb ("ALSA: dice: wait just for NOTIFY_CLOCK_ACCEPTED after GLOBAL_CLOCK_SELECT operation") Cc: <[email protected]> Signed-off-by: Takashi Sakamoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent ecae4c8 commit 9b84f0f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sound/firewire/dice/dice-stream.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int snd_dice_stream_get_rate_mode(struct snd_dice *dice, unsigned int rate,
5959

6060
static int select_clock(struct snd_dice *dice, unsigned int rate)
6161
{
62-
__be32 reg;
62+
__be32 reg, new;
6363
u32 data;
6464
int i;
6565
int err;
@@ -83,15 +83,17 @@ static int select_clock(struct snd_dice *dice, unsigned int rate)
8383
if (completion_done(&dice->clock_accepted))
8484
reinit_completion(&dice->clock_accepted);
8585

86-
reg = cpu_to_be32(data);
86+
new = cpu_to_be32(data);
8787
err = snd_dice_transaction_write_global(dice, GLOBAL_CLOCK_SELECT,
88-
&reg, sizeof(reg));
88+
&new, sizeof(new));
8989
if (err < 0)
9090
return err;
9191

9292
if (wait_for_completion_timeout(&dice->clock_accepted,
93-
msecs_to_jiffies(NOTIFICATION_TIMEOUT_MS)) == 0)
94-
return -ETIMEDOUT;
93+
msecs_to_jiffies(NOTIFICATION_TIMEOUT_MS)) == 0) {
94+
if (reg != new)
95+
return -ETIMEDOUT;
96+
}
9597

9698
return 0;
9799
}

0 commit comments

Comments
 (0)