Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp265495img; Mon, 18 Mar 2019 02:37:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkur+csnI6w8Th1xfnMemkiGPucAq/c4bPEGqynScX8M97CoeDlkFZQZa5kjjXW4ClV7td X-Received: by 2002:a65:4384:: with SMTP id m4mr16660651pgp.375.1552901828828; Mon, 18 Mar 2019 02:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552901828; cv=none; d=google.com; s=arc-20160816; b=DrXfZ+6iFR3vzwGPXQ7iD2bTiqVf5oHpd6NNXZ90fKlWLyY9idLcenslZo0b8KGlnx KLLBEDiKRX0gCYt7z1iM7qjYueIHQELfFP0AFGr8DhlqVXctlLETBjOvhg+vxXPP81Ex yry3rJvA5atNbjGChERRT926UKIMr1JcAW0epXdg9USyaNEHFOv6lYeuwVDjwweVcSWP aakfVL0vXuWHl2eYEsaxX/5HYsSq40oL95PNY4rAPwXZQGWlghNjgp+U87GnF/+T6q8U xXIXweZTd0TaMhljOPc5KZzyWKfmiYWM4RK8bEQOsN8yX50tN1xLQ+dcGu9j/6Bv6412 Bb/Q== 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=BYV0ke2RdRRu5S+vnTgRT0FgqVXEhzgMs00t/TS60ac=; b=eteMzUCUxuUKV7q+iir5q1kfEMPury2Tu+gSWwuMfQ6Y0YYkiCnfWx1HkP/AlYkhzl b4fujAIx/05fbs5Q7M9tBJl+KsoIxkPIulxa0S6vAYD6zHdVEe9ZdzdNPzg+2hNd/82n E+z01UhpuZAdk3ucOXybZyvxlgVusp7jrRp+EhYDinT4Yu95GTXfaF2P3iOn4YZTmlmO 38Ln3gikAskVm0yvRwKJJURLZQROpj8t9jzgRSYL5gZM0HIH40FaAG6/PAPfASUsLZlz pIH/e3/manQ/NniZkj/KfIpdGph7twpCfqUsSH42Pix4CYMlzpJA3Gm5+CZewdeoTNgs qDJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ynYqq8mt; 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 i31si8935936pgi.284.2019.03.18.02.36.53; Mon, 18 Mar 2019 02:37:08 -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=ynYqq8mt; 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 S2387473AbfCRJfd (ORCPT + 99 others); Mon, 18 Mar 2019 05:35:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:43902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387447AbfCRJfc (ORCPT ); Mon, 18 Mar 2019 05:35:32 -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 E99DE2087C; Mon, 18 Mar 2019 09:35:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552901731; bh=iQf7QXMcYGyirz9ERm0ut/OhgOuuGocUCo/B+/ympFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ynYqq8mtGprSmO+0EYZNz0jQ6p4Fvq28weFXB/pI5afYi7WoHUjYHU1M2UJVWaxDe +dk9oWS36DGngW1f60FGR7caJdFSvSB7hsyJraSEGQNjIiQ39xtcEWy7RSUGCPU0cU Qmc8srmsKOZjqCy3vPFuUp/FNbjmCHbKV50q/q1g= 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.14 30/34] ALSA: firewire-motu: fix construction of PCM frame for capture direction Date: Mon, 18 Mar 2019 10:25:54 +0100 Message-Id: <20190318084149.097681097@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190318084144.657740413@linuxfoundation.org> References: <20190318084144.657740413@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.14-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++; }