Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp264552img; Mon, 18 Mar 2019 02:35:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1ZSD9zuVCtPW4PvNqAFJeMSlPbagLioz3ew1yKfeeDoIf1DUYf8jCEwIzWw7mkgxCN2Yh X-Received: by 2002:a63:c804:: with SMTP id z4mr16317394pgg.228.1552901749027; Mon, 18 Mar 2019 02:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552901749; cv=none; d=google.com; s=arc-20160816; b=duBgcEkQnj9XAllJ2EnebjSA6gvrUjai1+EoR1ZivuXIaTHTqRvgbX7SSCV6NKCi3P hwAAQv/LxUiG4PB7lekXQX0tQhxMGZ1a6kxnB11iHBwl8N2C1ngdnqMaN5/PLu4vqljd UeBzAZL2FgVd7fv3k78Lc/NaRvvnNtvv+3W8FJFxnaob7KTkqMYuKQ+PbV5pO6txXHlr pas5hGjZmFYBxna0ZdSD+fAOCkI2e+UFn46A/UpoxTPQxsiU9NPEy5TPhHgyymVriSaB UCP+3WAULrMbJYOAd2DKco40OhkMfnXVA8doLnJyPwR7Rfw7ulrqcXla4P4ZRD1PF/3x 1VIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i70/Wa8UQl/bvJJA8x6WNTEDBPH7Uplhcd/IaeP4KM0=; b=Gx8Q2k8ZZrxgQFrZ2xe7kbAF78U+U9GpOzO6W7Bc+DJIbQZNLNwvP1FZqq+vPR77TY PwE17C6P8CGUd1T24QG8mj3hv/9Fii+DDxh2vZeBl4xiiAeJscXyeQydZvAy7vhqhEQQ BMB4AW0f1DGy9c7EmJNAHtxMMEAkCQj3DHL2j/GDiHkHHID9tLEIQoHss5x44EMpNaKR oVuXtExHZxCulPJM9o40QSrtZKT8z6xCSL2EMbqzjE31R56capYsqUom7LBF3jVVT5nj 2Eu966cSfAUnatyMiiWt9FgLX6WE/cejRrI6TPYBAK4ZyzcHY4MWTzdNnsP8fVSs6ep2 xP5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zX3y/+xz"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si8872199pga.351.2019.03.18.02.35.34; Mon, 18 Mar 2019 02:35:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zX3y/+xz"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728934AbfCRJd4 (ORCPT + 99 others); Mon, 18 Mar 2019 05:33:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:42236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728921AbfCRJdx (ORCPT ); Mon, 18 Mar 2019 05:33:53 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A8446214D8; Mon, 18 Mar 2019 09:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552901633; bh=gl+7B0CYp/efPD69FQ6AZLrcbBbhaZ4pZjya/agZwX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zX3y/+xz6yfvHEOsViHFtifl4JJlJ8m8R8qOgfCx45hof/h596ZIs9fXqg9CtioEP 74jgTdERM71HmtT1wHqx0VrBdaJuh54oOATvBCw3+Dfjs94YDfFZbQcs3yE2PxakqL 0m/cicZaf1NaiMDkDaJH9kQrJx5FkXIYGffRZVXY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Peter=20Sj=C3=B6berg?= , Takashi Sakamoto , Takashi Iwai Subject: [PATCH 4.19 40/52] ALSA: firewire-motu: fix construction of PCM frame for capture direction Date: Mon, 18 Mar 2019 10:25:37 +0100 Message-Id: <20190318084018.228063303@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190318084013.532280682@linuxfoundation.org> References: <20190318084013.532280682@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Sakamoto commit f97a0944a72b26a2bece72516294e112a890f98a upstream. In data blocks of common isochronous packet for MOTU devices, PCM frames are multiplexed in a shape of '24 bit * 4 Audio Pack', described in IEC 61883-6. The frames are not aligned to quadlet. For capture PCM substream, ALSA firewire-motu driver constructs PCM frames by reading data blocks byte-by-byte. However this operation includes bug for lower byte of the PCM sample. This brings invalid content of the PCM samples. This commit fixes the bug. Reported-by: Peter Sjöberg Cc: # v4.12+ Fixes: 4641c9394010 ("ALSA: firewire-motu: add MOTU specific protocol layer") Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/firewire/motu/amdtp-motu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/sound/firewire/motu/amdtp-motu.c +++ b/sound/firewire/motu/amdtp-motu.c @@ -136,7 +136,9 @@ static void read_pcm_s32(struct amdtp_st byte = (u8 *)buffer + p->pcm_byte_offset; for (c = 0; c < channels; ++c) { - *dst = (byte[0] << 24) | (byte[1] << 16) | byte[2]; + *dst = (byte[0] << 24) | + (byte[1] << 16) | + (byte[2] << 8); byte += 3; dst++; }