Received: by 10.213.65.68 with SMTP id h4csp1288619imn; Sun, 18 Mar 2018 23:11:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELuSo4UlWsFUR0XEK5nOFFr0DmcJ39Bf56RJff12hjM6h1yQ+0Ug5eUUFhjwD8/8prBqdGJ3 X-Received: by 2002:a17:902:143:: with SMTP id 61-v6mr11355049plb.345.1521439919871; Sun, 18 Mar 2018 23:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521439919; cv=none; d=google.com; s=arc-20160816; b=uRfChVlIs4bxyf7ZMav4qz+0GsvWuugmFaGxyjHg8cHNww4C43bBr//6tuqxAQjjQb MXsdKa6hivyObC/xU3Av/eWOVgctTN//kLFmcwtoJoKebZx+EOnEauUgqbvfuE+Z++U0 9CATcRtl63RzXwl58mIjKA9eQIW4Vm3c12OiL/KJpOy76I/q7OUa20JhvpFOrJCNYRo0 1DYl/3HrXPY2pAjPdSMGTBnn6bKKMTeX7vJo/8QU4g1DRsalxg4utnT7NUbS0K1Uh+KN 19x5ViVOSSeTD+SiFJ+3VdA6+j/sx9PBqo8fGoGG2pbhwp4x/6+Yw/yahE8dQRMFim84 ONeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=WeCQzlB6i5q/Mc80NhoPVqkp7KvwMOaBmrSbCZiP0s4=; b=iNDtXYvlnhGujj8pcXbefBBOYpjCZrnvbrBz7mR1oc7CsszZU/2f2GPxWT54cKOT9L fEGcVhvGm1RKFGZD941xbIzBL5VaoE3vAMpoHGTw+rpgPJiTck9VSpk1cXCK8rjC1gvS VwlQUiqCeaOpR9qvOMj/UEl+CCqq4STnVq0fXa6DlarvtU2IgM8M/zHq60qSy8zMCgwi W9jlimYNHLdolSO/gjNAmncCxnN7bJ+oqUo0EdPET+Uej4fZX+kUAlvHoT0vB/BkRwL/ 26UaDlGHXQr5g/nQ+k3yd08sRCwLJC51594PCw4JbSThTo6FpfqhkImzxLy8EMAhisd+ pTrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JsXH4Rx/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t192si8950651pgc.594.2018.03.18.23.11.45; Sun, 18 Mar 2018 23:11:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JsXH4Rx/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755279AbeCSGKw (ORCPT + 99 others); Mon, 19 Mar 2018 02:10:52 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36088 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755179AbeCSGKu (ORCPT ); Mon, 19 Mar 2018 02:10:50 -0400 Received: by mail-wm0-f67.google.com with SMTP id x82so376152wmg.1 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=ibTjDhkj7D5/zz2RJqxTgeodWT54gIqQ0aFB+WunepmBZaJNiUEB71w8Cx1JqG/n2g 41CMUDQLlmXhzVm+aTH5ET6+0WM8KHz5lYOGna5i89EkJCfLGv2VClnfqvsL84KDBpZ/ 0Fd0ap1crOXJi80ngnU1aggT7pE430ENLjTpJUVScfwE+E1GH43h8psahsTz5gw37MrP BSdsjRtXCTRhXKEK3cGmiWPVg1K8o22A0RSD0a21x1PXWqcbq3/b+41xJoI8BMg7cqiu P097Apls9yAmeBpOffcZ+dOr15OIwVM4hQqihui1F71dZPkyQfaxad27+uacJ7rsvR1d 8Gjg== X-Gm-Message-State: AElRT7ESb6snljM0JPe46CA3mvrgnKT4oabbwhb2D+Odvi/dISM2V7yM JqQheT4a7agAvP8Dx6hpdIE= 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 Cc: Kirill Marinushkin , Thomas Gleixner , Felipe Balbi , Philippe Ombredanne , Greg Kroah-Hartman , Ruslan Bilovol , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.13.6