From patchwork Mon Mar 19 06:11:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Marinushkin X-Patchwork-Id: 10291681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 599B2602BD for ; Mon, 19 Mar 2018 06:11:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 470AD29107 for ; Mon, 19 Mar 2018 06:11:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B8D929134; Mon, 19 Mar 2018 06:11:01 +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=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no 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 0786029118 for ; Mon, 19 Mar 2018 06:10:58 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D3ADB267299; Mon, 19 Mar 2018 07:10:56 +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 975562672BA; Mon, 19 Mar 2018 07:10:54 +0100 (CET) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by alsa0.perex.cz (Postfix) with ESMTP id 12EB3267294 for ; Mon, 19 Mar 2018 07:10:50 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id 139so13274958wmn.2 for ; Sun, 18 Mar 2018 23:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WeCQzlB6i5q/Mc80NhoPVqkp7KvwMOaBmrSbCZiP0s4=; b=JsXH4Rx/1s2Tr/NmH4qab51ns5sw3ytwFcuud5uDZtpfaCvIB2OXZbaVilYLadFeRG PmJBooVmx7+oZkSfjZHzhdJ51HRWmEHnIRcIoh99aIyU6dMLd/hpCbZ1x6nf7zqNQFT8 2KWExiXYla/w/qNAZN6kCnZyiAp1Uyobbmna2jo6aPSg20DF+Ljv/YcUbFmSchofwsuZ 0Z2xXr4pjxaE6JJ318In65bkwWvoWCpiZJZ8Oiq8tm1v86EqHr5K7ZrPN7mFD+B1Igf5 G+8sGYxQhXdWy4QopsVTUdSposSN10eSmXUPvlQ3dKNQAe5FdzBEzoULD/OoW5ZdGhlR cZaQ== 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; bh=WeCQzlB6i5q/Mc80NhoPVqkp7KvwMOaBmrSbCZiP0s4=; b=CbKYlUBTspIQNInVK6ts6/G+DUAVfHR2m/r0SPDL+IVPfWSWVa66Gohhg5FbRYAxCg yHxI5KG3+ZlY4tAg8Q7knONf75FVXi6LU/IJdz/fJ+oZ3R6LT1XYfR93DesX6ycNmaAr 9nAXdPlTuJsHDuelC2LFYThBIAbvhD3Wdp3O7wXDNnucPUiR7KpKRCD71v/zsgG18+dl FdpfMwP/Rwxs61pis2PZRPfY6CZxqCC8IU72URmW03h3T4ZOwFVGI9zu3+eLEzHhiFev 8t1JCcGiUPf64TfXEK+lRruQdwIPyeS80T4nw6GTcM9AJ3Xwx4/Y5gjidzMpnOALQLcA gwQQ== X-Gm-Message-State: AElRT7HIcoTD53AxUM5ad6MLPaiFoLGf8k75zkHlAqzpAuoKiKZrxFxA jBtb77pAIRQCO5gjBff5VN4= X-Google-Smtp-Source: AG47ELvKkfsoVTFi7hCJBfjEXoy9Bqsi/4ouCl478mQFn2GWsFNHsrK2EAZFbOFIXpqq9DGQ9+BlUw== X-Received: by 10.80.189.131 with SMTP id y3mr12329512edh.122.1521439849598; Sun, 18 Mar 2018 23:10:49 -0700 (PDT) Received: from gentoo0.localdomain (x4dbb2876.dyn.telefonica.de. [77.187.40.118]) by smtp.gmail.com with ESMTPSA id a43sm8900799edd.6.2018.03.18.23.10.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Mar 2018 23:10:48 -0700 (PDT) From: Kirill Marinushkin To: Mark Brown , Jaroslav Kysela , Takashi Iwai Date: Mon, 19 Mar 2018 07:11:08 +0100 Message-Id: <20180319061108.24178-1-k.marinushkin@gmail.com> X-Mailer: git-send-email 2.13.6 Cc: alsa-devel@alsa-project.org, Felipe Balbi , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Ruslan Bilovol , Philippe Ombredanne , Thomas Gleixner , Kirill Marinushkin Subject: [alsa-devel] [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, the offsets in the UAC2 processing unit descriptor are calculated incorrectly. It causes an issue when connecting the device which provides such a feature: ~~~~ [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18) ~~~~ After this patch is applied, the UAC2 processing unit inits w/o this error. Fixes: 5e1ddb481776 ("UAPI: (Scripted) Disintegrate include/linux/usb") Signed-off-by: Kirill Marinushkin Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Thomas Gleixner Cc: Felipe Balbi Cc: Philippe Ombredanne Cc: Greg Kroah-Hartman Cc: Ruslan Bilovol Cc: linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org --- include/uapi/linux/usb/audio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h index 17a022c5b414..da3315ed1bcd 100644 --- a/include/uapi/linux/usb/audio.h +++ b/include/uapi/linux/usb/audio.h @@ -370,7 +370,7 @@ static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_d { return (protocol == UAC_VERSION_1) ? desc->baSourceID[desc->bNrInPins + 4] : - desc->baSourceID[desc->bNrInPins + 6]; + 2; /* in UAC2, this value is constant */ } static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc, @@ -378,7 +378,7 @@ static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_de { return (protocol == UAC_VERSION_1) ? &desc->baSourceID[desc->bNrInPins + 5] : - &desc->baSourceID[desc->bNrInPins + 7]; + &desc->baSourceID[desc->bNrInPins + 6]; } static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,