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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 8E381C33C99 for ; Fri, 10 Jan 2020 07:29:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C80D20838 for ; Fri, 10 Jan 2020 07:29:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ivitera.com header.i=@ivitera.com header.b="NaXwj/CX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ivitera.com header.i=@ivitera.com header.b="NaXwj/CX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725879AbgAJH3L (ORCPT ); Fri, 10 Jan 2020 02:29:11 -0500 Received: from cable.insite.cz ([84.242.75.189]:58994 "EHLO cable.insite.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbgAJH3L (ORCPT ); Fri, 10 Jan 2020 02:29:11 -0500 Received: from localhost (localhost [127.0.0.1]) by cable.insite.cz (Postfix) with ESMTP id 808ACA1A40B08; Fri, 10 Jan 2020 08:29:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ivitera.com; s=mail; t=1578641347; bh=iqcaE9RCc8D/fTosyYCXQRgCUUKL11iXHS5akVhev6Y=; h=To:From:Subject:Date:From; b=NaXwj/CX4U9/kHOLrjlJrLOWKlL16GnyXnaJL6VeURoE2nmGohpFqN6cpnhoRjINu iLin+fhC7Pn7Iq57t2MTNHuiBIcIxnB9dTaupw/y3ncqN40+y5bp6TkNsTAqG5qZgo LJ4qaHLcdeMayQSAAOL1HqTbpPI/I2kkZIKaExHM= Received: from cable.insite.cz ([84.242.75.189]) by localhost (server.insite.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W78igCiAB9Iz; Fri, 10 Jan 2020 08:29:07 +0100 (CET) Received: from [192.168.100.32] (unknown [192.168.100.32]) (Authenticated sender: pavel) by cable.insite.cz (Postfix) with ESMTPSA id 4FBA9A1A40B01; Fri, 10 Jan 2020 08:29:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ivitera.com; s=mail; t=1578641347; bh=iqcaE9RCc8D/fTosyYCXQRgCUUKL11iXHS5akVhev6Y=; h=To:From:Subject:Date:From; b=NaXwj/CX4U9/kHOLrjlJrLOWKlL16GnyXnaJL6VeURoE2nmGohpFqN6cpnhoRjINu iLin+fhC7Pn7Iq57t2MTNHuiBIcIxnB9dTaupw/y3ncqN40+y5bp6TkNsTAqG5qZgo LJ4qaHLcdeMayQSAAOL1HqTbpPI/I2kkZIKaExHM= To: linux-usb@vger.kernel.org, Felipe Balbi From: Pavel Hofman Subject: USB:UAC2: Incorrect req->length > maxpacket*mc Message-ID: <4f2df2bc-e208-fffb-48e2-3e14cd093103@ivitera.com> Date: Fri, 10 Jan 2020 08:29:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Hi, Together with dwc2 maintainer Minas Harutyunyan we have been troubleshooting various issues of dwc2 on RPi4. We hit a problem where the g_audio in capture (EP OUT, playback from USB host) requests req-> length larger than maxpacket*mc. As a workaround we removed the check in dwc2/gadget.c, however that is not a proper solution. Minas with his team decided to add a patch where dwc2 will rejecting this type of wrong requests in dwc2_hsotg_ep_queue() function, to not process these request at all. The f_uac2 + g_audio gadget should restrain from sending such requests. Steps to reproduce: * Changing fs_epout_desc.bInterval in f_uac2.c from 4 (1ms) to 1 (125us) - the goal is to maximize available throughput of the audio gadget * Loading the g_audio module with c_srate=48000, c_ssize=2, c_chmask=2 - i.e. standard 48kHz/16bit/2ch USB playback -> alsa capture This combination produces mps=24 and mc=1 for EP OUT. Yet the audio function driver sometimes queues request with req->length 192. Please may I ask for fixing the audio function in this respect? Unfortunately that is way above my knowledge of that code/requirements. However, I can send debug dump for u_audio.c, f_uac2.c, gadget.c if needed. Thanks a lot in advance. Best regards, Pavel.