Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2981606pxj; Mon, 17 May 2021 14:48:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpSZxz6FY58/KiggdY6Sz2NGIKxSvTTv8mYdCGghlOQg47UJj0FwQKUf1c5SuDABdSMfT6 X-Received: by 2002:a02:7fc1:: with SMTP id r184mr2087379jac.109.1621288122315; Mon, 17 May 2021 14:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621288122; cv=none; d=google.com; s=arc-20160816; b=gVmjcuAumpsx9CVAV6OUQePYSDuK67szKX6G/3Ez2RhwQR3yYdbsal/wzFYspuyGOE Zr430NysaazxjLki6J6RwpKXGqQWKyw3g324Cm8wNr+teVfojalY61ZASoFAtTzA2r+b SZF2A9imPMMuVwWd8WvtDUBxyBgLERG7jg03HcRFlMH0l9ND26dWNlWCMkrwC9vl98p2 QHEPGqvvnHA8A2XQD7XWY0QYI6O/bCqN1ah9yhUPtA5qLJNa+i1Jhbc3YMZP0mfBji9F Nu7/eWf8SxdpbOI81oPPvJ86kIKM/TnEmW/LTVG2IxMEEe5kldT+8nncLNECcyrvVXIE JYkA== 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=SY/KcaKVV9md8CPzIWYCNa6F7+K8/jBpbYu6Okax39XHU4kKRiNMP8YX0ZFp6qU7Lw pV8ZbphcRlvHQaFKGBn2k0ksBgLBNIBwA0xQhTFQ4S3mCLieYvaLpK651thbXVdCdzx4 mXT+T9c1Gk6fQ/FXwZiYNojkvPRlLwlMdtlktZ/Q2j2HDfn6vR+ocdhEEHt5NDuAKQO9 L1U75SKoPlOWETBwkeuUPXEcKgUQSNX4QHOwnT9f9CrQCTxOSYx6U04oxZwKwmGMGUf2 Cei1PEfD06PkDsRebhKNvgbPzNqTNzIucYXghHYqeXcz76Ug9HEqjH2Ph/Xm0TCe183D QwMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tkL9njie; 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 k1si3823925ilu.64.2021.05.17.14.48.10; Mon, 17 May 2021 14:48:42 -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=tkL9njie; 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 S236642AbhEQOLY (ORCPT + 99 others); Mon, 17 May 2021 10:11:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:59664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238071AbhEQOJe (ORCPT ); Mon, 17 May 2021 10:09:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B8F4F611EE; Mon, 17 May 2021 14:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260407; bh=F+pne/Hjxiv7x9JXuhGkN38R9E5g7VxohpNgBfzPr/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkL9njieqWRSqO/8ZRdxADokpNUQfJZzW5yUrpx4vuyZKi/x+sIasWP248Ij2zgj4 qB91CzWGb8qQ/WMrOMiSi8YN4Sqb8rdGR9i/FmD5Lrr3h61ADQK1ByaAsBexUuYwsp eXJPw253GB9PQtKDzqnT9CSlNSzw7BKOyb6vu0UM= 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.12 032/363] ALSA: bebob: enable to deliver MIDI messages for multiple ports Date: Mon, 17 May 2021 15:58:18 +0200 Message-Id: <20210517140303.686018853@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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