From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B0C9C433ED for ; Tue, 18 May 2021 08:50:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 111FD610FA for ; Tue, 18 May 2021 08:50:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 111FD610FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A5B6916E6; Tue, 18 May 2021 10:49:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A5B6916E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1621327815; bh=PXw8fSI4DC+05mHbIjz9YMZPxHrG/+JhjeRSuxwxIag=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qMPqa5T7FIwXQIAIK0sXAqgl143kdZEvknN0g7TzYYs7nKLhOZpYYqZ/BPDXm1nYt nLabFSHlPTE6sLx5uiz8hUxJWrtieAIAruG9x9eD6ZsCYI20TvOieBegcGt7SzWUX7 il38rFiTOYmHeypgqCJQETiADzq7O39WeUtWLiEg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 519B1F804DF; Tue, 18 May 2021 10:46:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 98A3CF804AA; Tue, 18 May 2021 10:46:18 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EF6A7F8012C for ; Tue, 18 May 2021 10:46:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EF6A7F8012C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="SBrsgQE+"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="mN8e01dy" Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2FA025C019D; Tue, 18 May 2021 04:46:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 18 May 2021 04:46:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=Dl4zhhaUElYxk Vzb633kXpsz6Z1fkaDBmuQJ1CrWEHs=; b=SBrsgQE+AbS82SO9fjKbrRFuKVROe +9IdgxCvMnk4BfI54N7dD3pUo7P6+DGFL4fnkuKVxPKDJvKIeunIFAsbdZpx6hiD QKMwC5vyYH92Reo2UfD+BptCgwlR8D0aq/dVMtDPe6PAYAJZ1o+YaFgFoNJTfizd ZihfZoY3xyURdj1EzkZ7lw1ZBYokDXQPUfqJ16yg1bv8xn+sfsH1jLYXhFmjPjN0 Bj1K5TiURVRk5qKfL3Adhrvtuo6SVV7e6CPxS66PdVEKXpxa4/KtwXeFqabj9Bmh 6btvMnwMsAKhd7nlF7zi0ZXZgYQEXpK8N14uA7vZKUt6OhrkHUwEkgmiw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Dl4zhhaUElYxkVzb633kXpsz6Z1fkaDBmuQJ1CrWEHs=; b=mN8e01dy qkhBSfrWpQEQh2RJ5IKiIEwB5LX4O/+dbOqTniV0XmSEKrNy0kBc9yjuU5aZ5D15 CYacmP25Mx6C4mIX2TdLuKW6RsYQGrTV7VUIyh0wMeLwiveA80Plpu7DbM9AOVaE S4M/pn3Pz9YyLl6yMyH4gAYMdFRWsDIYlLxMm3jDDB7FpSosmJDkW+hSvG3iDV/c CtH3gBCOWtDdMWc7xD+8xXz/gEASsfQ5mX/v+aRF+2vle8zF6/2ANRSscvptiwU7 JviD3wK1jgWtlifg4OXBwHgOgJyAxbO73LTtxcHKTX4DZpzwnlTUAU8UdeKbDg1P TKDQbwaV8RRAXA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeijedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecuggftrfgrthhtvghrnhepveefffefke etgfevgeefleehfffhueejtdejveethfekveektdejjedvtdejhfejnecukfhppedugedr fedrieehrddujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhirdhjph X-ME-Proxy: Received: from workstation.flets-east.jp (ae065175.dynamic.ppp.asahi-net.or.jp [14.3.65.175]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 May 2021 04:46:13 -0400 (EDT) From: Takashi Sakamoto To: tiwai@suse.de Subject: [PATCH v4 09/11] ALSA: firewire-lib: code refactoring for jumbo payload quirk Date: Tue, 18 May 2021 17:45:55 +0900 Message-Id: <20210518084557.102681-10-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210518084557.102681-1-o-takashi@sakamocchi.jp> References: <20210518084557.102681-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, clemens@ladisch.de X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" A new macro is added to describe the maximum number of cycles to accept cycle skip by jumbo payload quirk. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index b14c3922efb2..409274a532ed 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -64,6 +64,11 @@ #define IT_PKT_HEADER_SIZE_CIP 8 // For 2 CIP header. #define IT_PKT_HEADER_SIZE_NO_CIP 0 // Nothing. +// The initial firmware of OXFW970 can postpone transmission of packet during finishing +// asynchronous transaction. This module accepts 5 cycles to skip as maximum to avoid buffer +// overrun. Actual device can skip more, then this module stops the packet streaming. +#define IR_JUMBO_PAYLOAD_MAX_SKIP_CYCLES 5 + static void pcm_period_work(struct work_struct *work); /** @@ -316,7 +321,7 @@ unsigned int amdtp_stream_get_max_payload(struct amdtp_stream *s) unsigned int cip_header_size = 0; if (s->flags & CIP_JUMBO_PAYLOAD) - multiplier = 5; + multiplier = IR_JUMBO_PAYLOAD_MAX_SKIP_CYCLES; if (!(s->flags & CIP_NO_HEADER)) cip_header_size = sizeof(__be32) * 2; -- 2.27.0