Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3545910pxj; Mon, 24 May 2021 09:05:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWZxQhBfo49QNqFM+AIeVZ0P5JJYm+UAzV/Fn9zDFKoUrPDNGLGCwoDqGt97gutcgfqZjp X-Received: by 2002:a02:c04c:: with SMTP id u12mr24757914jam.129.1621872317162; Mon, 24 May 2021 09:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872317; cv=none; d=google.com; s=arc-20160816; b=LfTvntMqg/l5p/vtyr27DRR+LonAEuIV5VAHr8pEK34zqpl/wgJ/my6JiOX0NmdGOb SuLp0faSHOkNoifSlEDaVazRJphXusr+5mXahcEqRo6QqY/stjYVJ2SJhdAxe6Fcx0Y1 yfgVX6q5af8+Gw02DvhI5Y05x0f3G1kAHe4++KkxlT1BfPdPkWkvOutMrbNIerkAWh9H QOIFTNiBsCVJ7a08I6hn/+IIV13bZIQ1jhKJ6s+950myp2R3OxARfsNCkJc7bBR6anlw q0yr2JNvDmx980qSfpOn6AG4/r1ovHAXlPnjV4k5OKngAYuTG6QQGT2gM9RWrAPGs0lM x+XA== 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=pM7YzEwx9eHoj+I7Qe4Jv/1y0j3j1aYhpXOH2hLVhTQ=; b=v7033BV7fMsqXZ8tepY2GKCF6m4IuLPwfdjbd6JRmiZtj4FtBhA5P9OLu35Lk+0EDZ eyIzYkHm11dj/sZ6ixLfQ+HTCwyyUpGYPjO0Nv3RBHmKiF/OI1WWzCtnvvIQbrsVWhQB H7PlnIjaR5maOyzniplO2wBJoqkbi1SKyT0nJsfqSMQv7DLfGYBeItChzLRDXzKH93br ttEaNpANQk+suTQbwotuCrBQoXq+b2Svb/eCL0XaOF9XngJzOwkg6Eu9hfjNAw2Xo21f QGCUJxLFEKatZvQKy1YhGZtFsNfDg/rs/s9Kb/wD+C1+ZfycPme1akLBdRMLVcvrXTfu Ms6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="j/Lug29z"; 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 g3si15861343jan.54.2021.05.24.09.04.56; Mon, 24 May 2021 09:05:17 -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="j/Lug29z"; 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 S237173AbhEXQFM (ORCPT + 99 others); Mon, 24 May 2021 12:05:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:40480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235249AbhEXP6q (ORCPT ); Mon, 24 May 2021 11:58:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E43E661964; Mon, 24 May 2021 15:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871070; bh=TM2KUuyDB8NaJB2CiidIrsob6FcjUAVXJa3HAnIJwWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/Lug29zecaaMVC/WNQ0F2YNvgJWh6IK+PlsEaDMCMzrrg6dadupY3QEDXViuHpLy 79aqu7jzCaPE/sso3kharRBV9AOVtdgwEnCwkPwq8VPzYNkSoQsoHmW0eKCZMFLLr+ F2XGSAsrtuDqjB5OnWqp1hrW/B9khciotcGWtKTM= 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.12 047/127] ALSA: firewire-lib: fix calculation for size of IR context payload Date: Mon, 24 May 2021 17:26:04 +0200 Message-Id: <20210524152336.438862305@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@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 @@ -1068,23 +1068,22 @@ static int amdtp_stream_start(struct amd s->data_block_counter = 0; } - /* 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; }