From patchwork Sat Dec 15 10:03:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10732107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 289BA14E2 for ; Sat, 15 Dec 2018 10:04:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 135AF28815 for ; Sat, 15 Dec 2018 10:04:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 078C9288A7; Sat, 15 Dec 2018 10:04:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5759E28815 for ; Sat, 15 Dec 2018 10:04:06 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 53AAF267A94; Sat, 15 Dec 2018 11:03:58 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1135C267AA7; Sat, 15 Dec 2018 11:03:53 +0100 (CET) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by alsa0.perex.cz (Postfix) with ESMTP id 69A17267A94 for ; Sat, 15 Dec 2018 11:03:51 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id z23so3890433plo.0 for ; Sat, 15 Dec 2018 02:03:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wZ8dlXEMQfOaa+5pA1NnFH03uvMvezvdSeLe0KSauMo=; b=XcE0BVq+KucWV7SZhjHSKUDzyhCmKv44G12pf5Ny3Wr9lK5zfvLWxxUNiIVtb38YtH lrQOowMKdC2vaBlPNyfNCwMrtnu3ONIYGisLwgfVtgvI5EpBeC7eyIwHXZVxvOz6tKkZ 6DsyKAskTMe7bbS4ZX7xUuY3Uq5Q9ai2hN2gHyFcv8hs6AplrEgPQr9CS59w6x/ZOBqg qvgkVgrltlqJ8D+hVhOJd5DazvEVtKlckwt5SpiNch8E9ebIZy1oEerT4TZlT/zSFvPH XZLpLNioT3Zj9pytIaz95ckpjmlG9m/ASK/6DcUgN3t4QK2dy0sQlbO+A9XDjdysFR54 89+Q== X-Gm-Message-State: AA+aEWaTm3QMrZk/g7QJax4lojAYwvxyeFvjhc2FPvAWeClvUMOdHxmu kqQNd7BjNGJfuocx+nDS5FNLKLk4 X-Google-Smtp-Source: AFSGD/XNG170NZm6gtk5y+Lkx5sK8vJT4FRG3czmaeVuSBvkzjcexSWny/0jgfoo4hykCwH0ubLX3g== X-Received: by 2002:a17:902:9006:: with SMTP id a6mr5852514plp.334.1544868230285; Sat, 15 Dec 2018 02:03:50 -0800 (PST) Received: from localhost.localdomain ([2405:6580:9660:3200:158:7414:91fa:c7]) by smtp.gmail.com with ESMTPSA id 85sm10676758pfw.17.2018.12.15.02.03.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Dec 2018 02:03:49 -0800 (PST) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sat, 15 Dec 2018 19:03:19 +0900 Message-Id: <20181215100321.1658-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181215100321.1658-1-o-takashi@sakamocchi.jp> References: <20181215100321.1658-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org Subject: [alsa-devel] [PATCH 1/3] ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In IEC 61883-1/6 engine of ALSA firewire stack, a packet handler has a second argument for 'the number of bytes in payload of isochronous packet'. However, an incoming packet handler without CIP header uses the value as 'the number of quadlets in the payload'. This brings userspace applications to receive the number of PCM frames as four times against real time. This commit fixes the bug. Cc: # v4.12+ Fixes: 3b196c394dd ('ALSA: firewire-lib: add no-header packet processing') Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 9be76c808fcc..3ada55ed5381 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -654,15 +654,17 @@ static int handle_in_packet(struct amdtp_stream *s, } static int handle_in_packet_without_header(struct amdtp_stream *s, - unsigned int payload_quadlets, unsigned int cycle, + unsigned int payload_length, unsigned int cycle, unsigned int index) { __be32 *buffer; + unsigned int payload_quadlets; unsigned int data_blocks; struct snd_pcm_substream *pcm; unsigned int pcm_frames; buffer = s->buffer.packets[s->packet_index].buffer; + payload_quadlets = payload_length / 4; data_blocks = payload_quadlets / s->data_block_quadlets; trace_in_packet_without_header(s, cycle, payload_quadlets, data_blocks, From patchwork Sat Dec 15 10:03:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10732109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DACC7746 for ; Sat, 15 Dec 2018 10:04:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C418929F0C for ; Sat, 15 Dec 2018 10:04:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B76232BF97; Sat, 15 Dec 2018 10:04:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2560B29F0C for ; Sat, 15 Dec 2018 10:04:14 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A6FA7267AB2; Sat, 15 Dec 2018 11:03:59 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B7E67267A8E; Sat, 15 Dec 2018 11:03:55 +0100 (CET) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by alsa0.perex.cz (Postfix) with ESMTP id E04E6267A8E for ; Sat, 15 Dec 2018 11:03:53 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id p8so3890002plo.2 for ; Sat, 15 Dec 2018 02:03:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+FSMyXt2pxl8kbP6q9HDSbd8IVkRo/SIh6qgTb43BkQ=; b=Xt/HATeZanZcrtZBm84g1P5Rv6zDxiTBmvascczeLXDiAFbz2+JFm/qD3V8cQUVJ0m aB6X5q09FVjpFwwBZrwB6vqwx2aU0BsCr318dRz0sNrebPd/VOgRkfJCDw0lJk5pjnS4 sPJo/P8exeWWCzxgewPn897gFJElO3EfbcGJ4lY0N6t+/P15hhxxh6NQhofg79tI9O9U /wDEr1PiuiVBhBcIh7GD3+CL5bNMX2tF2A0wGuqL8olSKPCSWc3CdphTM/DTsQHy5jqq /VHvcZLDUSX9diyeD2oHdKbVYY4Dx7MVgbFzQ1tQY5r7Y3gU9VdcSACwowqor6j4/Z1I xIAw== X-Gm-Message-State: AA+aEWaBSWHmJaAFNBfYGRImVkAlYRnTC2COrLw4I8BRykBnli+PbBjY RsBCZSEn21k6WskaeppVnrjY9IaA X-Google-Smtp-Source: AFSGD/XBsu+c/QETg5FtXIZqL21bHLRqrAYrYdLCuayqwV30II7XTZNMvZrc4rlqumtF2NxXvyclMw== X-Received: by 2002:a17:902:6bc7:: with SMTP id m7mr6038865plt.106.1544868232208; Sat, 15 Dec 2018 02:03:52 -0800 (PST) Received: from localhost.localdomain ([2405:6580:9660:3200:158:7414:91fa:c7]) by smtp.gmail.com with ESMTPSA id 85sm10676758pfw.17.2018.12.15.02.03.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Dec 2018 02:03:51 -0800 (PST) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sat, 15 Dec 2018 19:03:20 +0900 Message-Id: <20181215100321.1658-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181215100321.1658-1-o-takashi@sakamocchi.jp> References: <20181215100321.1658-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org Subject: [alsa-devel] [PATCH 2/3] ALSA: firewire-lib: fix wrong assignment for 'out_packet_without_header' tracepoint X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP An initial commit to add tracepoints for packets without CIP headers introduces a wrong assignment to 'data_blocks' value of 'out_packet_without_header' tracepoint. This commit fixes the bug. Cc: # v4.12+ Fixes: b164d2fd6e49 ('ALSA: firewire_lib: add tracepoints for packets without CIP headers') Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream-trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h index 54cdd4ffa9ce..c05b3da0aa1c 100644 --- a/sound/firewire/amdtp-stream-trace.h +++ b/sound/firewire/amdtp-stream-trace.h @@ -169,7 +169,7 @@ TRACE_EVENT(out_packet_without_header, __entry->dest = fw_parent_device(s->unit)->node_id; __entry->payload_quadlets = payload_length / 4; __entry->data_blocks = data_blocks, - __entry->data_blocks = s->data_block_counter, + __entry->data_block_counter = s->data_block_counter, __entry->packet_index = s->packet_index; __entry->irq = !!in_interrupt(); __entry->index = index; From patchwork Sat Dec 15 10:03:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10732111 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6A476C5 for ; Sat, 15 Dec 2018 10:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0A5829F0C for ; Sat, 15 Dec 2018 10:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94C102BF97; Sat, 15 Dec 2018 10:04:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4199B29F0C for ; Sat, 15 Dec 2018 10:04:22 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 63F59267AC1; Sat, 15 Dec 2018 11:04:03 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A92E9267AB4; Sat, 15 Dec 2018 11:03:58 +0100 (CET) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by alsa0.perex.cz (Postfix) with ESMTP id 001AE267AAA for ; Sat, 15 Dec 2018 11:03:55 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id c72so4029687pfc.6 for ; Sat, 15 Dec 2018 02:03:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5EUyENVJOJz9eBBl93LbPOUacPMTHGG5Yv5QlD/aJdA=; b=OBOVGOxJMvOKGdTCvRFCmiPiaf8mRUMOPryl0XiwLV1YErJay/MU8AGJr1Ou/nyLSx 6B/tPNFoeyeMXqxpjG4yPXuUt1cZci25Je72yHBbMdfcFUto4YmGLLNRs43rSpzSCDFU BjE8kykqMDrKandLeq0cTAU3QWj7uAA0d/zPtTDYjXkUl5U7RsINKq4E3QISwo6dSBgq qapiXjSUWj4MKMXVTQ2shSI17x1XXGdIf6bbj0ixU701xbUI2KBMmZiwVFzYvAOJ2jyj +qsvd+42iyU1at+57Xp5mr+cbhSmvZuLXQ+DCHi82OadZBS4xY1F0JbqxFb3tyG+Y4VU cV7w== X-Gm-Message-State: AA+aEWYyfR2hsx7EwrN23xew1MBt57wxvC2D0GNSqm3a309XJ3MAUCCi vIgwDhm5UZn81xE841mLQtw92JAz X-Google-Smtp-Source: AFSGD/WySJvXHBNcf2QJP/vspJAAiP7sDEgtKX3t0fm3RkctwX8XBKGMgwiQD1Ys7ZnPAx/0vfhqWw== X-Received: by 2002:a63:a16:: with SMTP id 22mr5655605pgk.318.1544868234101; Sat, 15 Dec 2018 02:03:54 -0800 (PST) Received: from localhost.localdomain ([2405:6580:9660:3200:158:7414:91fa:c7]) by smtp.gmail.com with ESMTPSA id 85sm10676758pfw.17.2018.12.15.02.03.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Dec 2018 02:03:53 -0800 (PST) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sat, 15 Dec 2018 19:03:21 +0900 Message-Id: <20181215100321.1658-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181215100321.1658-1-o-takashi@sakamocchi.jp> References: <20181215100321.1658-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org Subject: [alsa-devel] [PATCH 3/3] ALSA: firewire-lib: use the same print format for 'without_header' tracepoints X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP An initial commit to add tracepoints for packets without CIP headers uses different print formats for added tracepoints. However this is not convenient for users/developers to prepare debug tools. This commit uses the same format for the two tracepoints. Cc: # v4.12+ Fixes: b164d2fd6e49 ('ALSA: firewire_lib: add tracepoints for packets without CIP headers') Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream-trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h index c05b3da0aa1c..ac20acf48fc6 100644 --- a/sound/firewire/amdtp-stream-trace.h +++ b/sound/firewire/amdtp-stream-trace.h @@ -131,7 +131,7 @@ TRACE_EVENT(in_packet_without_header, __entry->index = index; ), TP_printk( - "%02u %04u %04x %04x %02d %03u %3u %3u %02u %01u %02u", + "%02u %04u %04x %04x %02d %03u %02u %03u %02u %01u %02u", __entry->second, __entry->cycle, __entry->src,