Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3538237pxj; Mon, 24 May 2021 08:56:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/kc5bq07RR86Awo/O6Uq+5LrIY9wq4N7boZl5k0vsW+/gePA9HksL3w5fHjtOz86o6Mer X-Received: by 2002:a02:ca0d:: with SMTP id i13mr24721093jak.98.1621871818561; Mon, 24 May 2021 08:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621871818; cv=none; d=google.com; s=arc-20160816; b=ZWhBIWjz81BgbroRK4ylzhnccvfFMf96xUjYaKQhNZ9DRLmeHKuAAClXWdD1zDEgly ZTOj9qiKVZPmf/VqNfoTSNpSjJdpEMT53PLRLpBwk3JZIBMwcKxbovH8pEK2JLSJiOWo QxDr4sfEm54sNbA9EQANQHDHStk0NNUDqdgHzMKXRq0c9ziesaDCNnBxp59Ll0m0Myev QcvwTMF/SRYIuMoztjazvUHhO0P33iMG8H0Z8pVrusHBo6GWvn5kaumQSh1cUQM/ojJX MwLK8cSeUroK91pfcHnUoE3pThbdAL4sy6Vymzuv+6D6Z0eqeebinWI1v3Xw8MUa655U y1eA== 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=wdFenq2OcSeQ0JzTS8BKmCjSy0DSnK3Qc+Yp+b+W6So=; b=U6DmM10epp6pWyTcCiA/tTyOyUUooXjMNqNAAkGNeYoL6+QhUbWDqTNeG9pVnoNcx/ ICUqU7E6l/hOZmeQU+ZpcznmpZoyEFW0fmwpIjq+fYSG1+YWxolm9clwgbUS5pr1f/1B 0rSye3SWDU0EtWMxSYAXUDQkIkcyGpY5YD7kmp3YIHkeQV7MDiEHHSv1AG+dEojOCeJl QmzdkIffjauBwa0tLR8jU9pPjn4F7HnG1QImOtvme5DOz7tMovaT59g2l89M9RyCQdc1 c2xvWBIgEm9pkZDmpOv2WTH/wy3D2yxN9o0I7ALZbXOjDpBIs28qnvbLBKBrpk8AXwUQ OQEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GRkp8SRp; 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 y3si1155680jad.12.2021.05.24.08.56.44; Mon, 24 May 2021 08:56:58 -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=GRkp8SRp; 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 S235207AbhEXP4D (ORCPT + 99 others); Mon, 24 May 2021 11:56:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:33886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234073AbhEXPs0 (ORCPT ); Mon, 24 May 2021 11:48:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A0AAE6140C; Mon, 24 May 2021 15:37:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870643; bh=r+qOUP8I1x0Uf3zaMaSpwtVegyi7cRYHHzO84PIlcko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GRkp8SRpPCkP+QA+VMJO1uMreQhk/OKAzv105Xm0r9oLgMAu+xiK4JTSM6WLCSuS0 9O28OXoYQ7jVI8GBGsEpk2SPZ+x3pf3wZcRusCwtvrW7AmkgEP/Wp1UkCkb7/tOGjC 686agVVyPOPQnFvydbj/5l/PkvOd09e8DWfeORVE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai Subject: [PATCH 5.4 22/71] ALSA: firewire-lib: fix calculation for size of IR context payload Date: Mon, 24 May 2021 17:25:28 +0200 Message-Id: <20210524152327.185524929@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152326.447759938@linuxfoundation.org> References: <20210524152326.447759938@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 commit 1be4f21d9984fa9835fae5411a29465dc5aece6f upstream. The quadlets for CIP header is handled as a part of IR context header, thus it doesn't join in IR context payload. However current calculation includes the quadlets in IR context payload. Cc: Fixes: f11453c7cc01 ("ALSA: firewire-lib: use 16 bytes IR context header to separate CIP header") Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210513125652.110249-5-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/firewire/amdtp-stream.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -932,23 +932,22 @@ static int amdtp_stream_start(struct amd s->ctx_data.rx.last_syt_offset = TICKS_PER_CYCLE; } - /* initialize packet buffer */ + // initialize packet buffer. + max_ctx_payload_size = amdtp_stream_get_max_payload(s); if (s->direction == AMDTP_IN_STREAM) { dir = DMA_FROM_DEVICE; type = FW_ISO_CONTEXT_RECEIVE; - if (!(s->flags & CIP_NO_HEADER)) + if (!(s->flags & CIP_NO_HEADER)) { + max_ctx_payload_size -= 8; ctx_header_size = IR_CTX_HEADER_SIZE_CIP; - else + } else { ctx_header_size = IR_CTX_HEADER_SIZE_NO_CIP; - - max_ctx_payload_size = amdtp_stream_get_max_payload(s) - - ctx_header_size; + } } else { dir = DMA_TO_DEVICE; type = FW_ISO_CONTEXT_TRANSMIT; ctx_header_size = 0; // No effect for IT context. - max_ctx_payload_size = amdtp_stream_get_max_payload(s); if (!(s->flags & CIP_NO_HEADER)) max_ctx_payload_size -= IT_PKT_HEADER_SIZE_CIP; }