Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp233243pxj; Tue, 18 May 2021 02:02:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt1xVZfkE82LLzZL9WQ8nhf8p5NYYc0kl+N+WM7dUjMAaUTIimiJlNhzMSKLFGeSElV46N X-Received: by 2002:a17:906:2ad2:: with SMTP id m18mr5034571eje.44.1621328528005; Tue, 18 May 2021 02:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621328527; cv=none; d=google.com; s=arc-20160816; b=DrqyLPJZDLas51HAyJkAFVD5Nx0ESAMZn2Kbjvl7Ldmj/bEwHRhSj/owMnAxH8W9z2 Op9OZxHIVP7C7gbsZYwkTdpfEs8zdg9EUwy/5MZ3xnJN05DRGzT/sK52K6KGC/VT2sOM SPfh57Xzzixikr4tGGqxRLIFcs2n30wH3/JTeht+Ibf/XksnzAbpAmMc5tmaBKlBJgGc tvghjVL9SAYyVpQF0kzVbDbPBYkw14lfjuFjAnE/xpWCT9Mhs7EsT7u9d1EoQ2igmyxz 4sSTGik6VYupAgtSqpmymx5+Om/NrmOnEhOxxmvAPTVolk8DWQa+YYBKfW97WVQzHczb YHwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MhHaQ5xoJLmyDEapvdcbH8RFoYTKCrHcn77qCEG0m7A=; b=OWne90m3CM2zFHBnVxOxFSOPaeSHVeMkp78p1IWUuGUNlXEGLhYFVN6J3v3+YPydqQ ChvqorF2A9YxFHCiLBNpLZA4pisa17Bqws4NQ6LF8vi8aHZMwm+YRMPvr7exRyksjr3Y ocK3e4K2GC8daTw6pjF5mi5aRpnwkeVFazrYUmALqcML0aSX57SOhjCxQ9uj4XNbp8eM 94zlYW9GgWltkJCov7Z6OXYtIoHid6FZTFNlPNn2jn/gDW1pZh6rNzzoc/qs7HcbpcPQ yjarVC4qObbVkl2NFJCj4wu7Ia3AQh2PbQmfQPS3mu4uMv06MOxlT9F0afcFi5Td3/x+ twjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X6tWkbyZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k26si19135352eds.458.2021.05.18.02.01.44; Tue, 18 May 2021 02:02:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X6tWkbyZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242815AbhEQPEt (ORCPT + 99 others); Mon, 17 May 2021 11:04:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:49498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242266AbhEQOyw (ORCPT ); Mon, 17 May 2021 10:54:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3C054619B7; Mon, 17 May 2021 14:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261490; bh=F+pne/Hjxiv7x9JXuhGkN38R9E5g7VxohpNgBfzPr/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X6tWkbyZaXTnOnuRSXjnLtvGdq9A7OUJXhlc4i8VU7yXfhLrqrL/g2HLZsmUyzQO9 5SHFwNL5XH/b3KCnpQzXQYRUAj9o+7i2f7vYvSBGgyzT9wzgjyHFYrDA7E1ipYE/o3 0rPsjZPMwu8CruHW22SP4gZt0ZUFK2FOkZ1LBc2Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai , Sasha Levin Subject: [PATCH 5.10 026/289] ALSA: bebob: enable to deliver MIDI messages for multiple ports Date: Mon, 17 May 2021 15:59:11 +0200 Message-Id: <20210517140306.066512020@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Sakamoto [ Upstream commit d2b6f15bc18ac8fbce25398290774c21f5b2cd44 ] Current implementation of bebob driver doesn't correctly handle the case that the device has multiple MIDI ports. The cause is the number of MIDI conformant data channels is passed to AM824 data block processing layer. This commit fixes the bug. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210321032831.340278-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/firewire/bebob/bebob_stream.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index bbae04793c50..c18017e0a3d9 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -517,20 +517,22 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob) static int keep_resources(struct snd_bebob *bebob, struct amdtp_stream *stream, unsigned int rate, unsigned int index) { - struct snd_bebob_stream_formation *formation; + unsigned int pcm_channels; + unsigned int midi_ports; struct cmp_connection *conn; int err; if (stream == &bebob->tx_stream) { - formation = bebob->tx_stream_formations + index; + pcm_channels = bebob->tx_stream_formations[index].pcm; + midi_ports = bebob->midi_input_ports; conn = &bebob->out_conn; } else { - formation = bebob->rx_stream_formations + index; + pcm_channels = bebob->rx_stream_formations[index].pcm; + midi_ports = bebob->midi_output_ports; conn = &bebob->in_conn; } - err = amdtp_am824_set_parameters(stream, rate, formation->pcm, - formation->midi, false); + err = amdtp_am824_set_parameters(stream, rate, pcm_channels, midi_ports, false); if (err < 0) return err; -- 2.30.2