Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5503119rwb; Tue, 22 Nov 2022 00:30:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4b6U3WmPQ+DyERMR57XFziaZQfDEFrw31OLDGYqKL+WxGl0XBjdky33QRJSPAXZtGNYRVT X-Received: by 2002:a05:6402:100b:b0:461:f1c6:1f22 with SMTP id c11-20020a056402100b00b00461f1c61f22mr5784967edu.95.1669105809835; Tue, 22 Nov 2022 00:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669105809; cv=none; d=google.com; s=arc-20160816; b=w+RwqPcHIreZM3iZ9hSxdoQ655G571b10Jk31i5nDn6a2IcmPTcnWMrwYb5v/+XBpM 1npaoXWVg1SZxGMeiiAM3/b+Ths6JgmDZ3JI7fiYpE7MLC96hmx5Bptn/xAf5HI7rfI6 oSnQXAd0Pt+yo/QqxxBSF0pp8wilfuwskHPYthHMqLL9c+9/Q2p1TY9izSI1EX1Bk9eo 1AYP8HmsvNHstwoQMDdYuHFc8NKxmO5iwTAxnmzhY4+y2jAU7kRK480KjjXNK6BnQrhN lWC2XLX5HpnHutVkfQxHs1ZnE9rhwoZdHQa/5ZkiaLTI49VyUpyI3tOeYyy1Aak7ERCT rFBQ== 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 :message-id:date:subject:cc:to:from; bh=6C5ycclEwhv8DTYPNeROZoIK+tr/HDUqMAQdxBS7I6w=; b=n5TRWydy2wuA6OMcWaGFIvE0mBnnZ113ixSU/gs0OAkbMbi0tyIvhOiYCNs75RXlcD mzSiUqJKINcqTdQrwEs15Xv1N34W8ZN7smHXlccTdqSakW08zdRyC5QAuu2d2PlMdpHV jO8RF5qx27dT2496G0eCni6u871PFRlrU+b4j1zz9lwvheoaMKkxu+ZhA8zqWcNsjHLi gz4J6nQ4/e64SVy1zB7Eam/iF0CFhZdjlOMhaaPF7dbQlpe3d8i3wacYkyxKWigbcEyS Ou9mGkWdng7nOpx35Sg4OfV1AtbaYxlnTpqWaoQjeVcM7ouCLdXokK6lUJU/5imhGjGo prug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j11-20020a05640211cb00b0046627848e32si12511739edw.634.2022.11.22.00.29.44; Tue, 22 Nov 2022 00:30:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232695AbiKVIVP (ORCPT + 91 others); Tue, 22 Nov 2022 03:21:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232605AbiKVIVL (ORCPT ); Tue, 22 Nov 2022 03:21:11 -0500 Received: from out29-121.mail.aliyun.com (out29-121.mail.aliyun.com [115.124.29.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDD5C40443 for ; Tue, 22 Nov 2022 00:21:08 -0800 (PST) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.08002614|-1;BR=01201311R161S84rulernew998_84748_2000303;CH=blue;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.00516761-0.000814287-0.994018;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047201;MF=michael@allwinnertech.com;NM=1;PH=DS;RN=8;RT=8;SR=0;TI=SMTPD_---.QE3zAv6_1669105264; Received: from SunxiBot.allwinnertech.com(mailfrom:michael@allwinnertech.com fp:SMTPD_---.QE3zAv6_1669105264) by smtp.aliyun-inc.com; Tue, 22 Nov 2022 16:21:05 +0800 From: Michael Wu To: perex@perex.cz, tiwai@suse.com, aichao@kylinos.cn, wanjiabing@vivo.com, ubizjak@gmail.com Cc: tiwai@suse.de, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: usb-audio: fix urb timeout with URB_ISO_ASAP flag Date: Tue, 22 Nov 2022 16:20:40 +0800 Message-Id: <20221122082040.48591-1-michael@allwinnertech.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the loglevel is greater than 4, with a long messages printed on the console while playing or recording audios, the usb controller may become abnormal. `usb 1-2: timeout: still 1 active urbs on EP #1` Fix it by configuring the transfer_flags URB_ISO_ASAP flag. Signed-off-by: Michael Wu --- sound/usb/endpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 310cd6fb0038..df9a91c2fc7d 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -1245,7 +1245,7 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep) if (!u->urb->transfer_buffer) goto out_of_memory; u->urb->pipe = ep->pipe; - u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; + u->urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; u->urb->interval = 1 << ep->datainterval; u->urb->context = u; u->urb->complete = snd_complete_urb; @@ -1288,7 +1288,7 @@ static int sync_ep_set_params(struct snd_usb_endpoint *ep) u->urb->transfer_dma = ep->sync_dma + i * 4; u->urb->transfer_buffer_length = 4; u->urb->pipe = ep->pipe; - u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; + u->urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; u->urb->number_of_packets = 1; u->urb->interval = 1 << ep->syncinterval; u->urb->context = u; -- 2.29.0