From patchwork Mon May 11 16:37:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 6379401 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A82E1BEEE1 for ; Mon, 11 May 2015 16:38:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 713D420880 for ; Mon, 11 May 2015 16:38:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3319F20869 for ; Mon, 11 May 2015 16:38:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E97FF26530A; Mon, 11 May 2015 18:38:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id D0F3D2651B4; Mon, 11 May 2015 18:38:25 +0200 (CEST) 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 B92D32651B7; Mon, 11 May 2015 18:38:24 +0200 (CEST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by alsa0.perex.cz (Postfix) with ESMTP id F353E2650D1 for ; Mon, 11 May 2015 18:38:16 +0200 (CEST) Received: by widdi4 with SMTP id di4so112986939wid.0 for ; Mon, 11 May 2015 09:38:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=j8QleZj57ghRL0LCdSgrbPg9oJGuW3VFf7xg6nUZ9wE=; b=fjc1ExkTvTxX6gU7iVhL/ERqtRkPHFhQKeCfIRxAQYKdnSf9kTAg1u+NIYA/UIYZg7 xeBrTQKMnFdklek7oXvA68hT9eWvtIUsaiLZBAlW/ut/yX/uzuuYZpxkSh58xX4NGbJE gmDSvpY6gwcr3mooUTLMW0whb8yzAsT6ZydNbXSHs1t4vcWnWWRGm1olW6Q/CawsOoeT AsDPHBEmMOXmIQYWO4q6Djn2heVx3gIUreWA6bAEAGIU1BznZV30XdtBByXRoSIzc9Bj wJeSph/omGW85gFXRxi1b2QmPzrRDnoIBPoBSxOMLuwbSeWoT6eOVYA7l1fbvZ7tBM+J HW0w== X-Gm-Message-State: ALoCoQm8BY9yJzfIN6TVTmvP5ltK8o7EHZptQQBCLX1CIHV+jSLg4u9WcaS5M6z/l42PYRaZS/Rt X-Received: by 10.194.78.12 with SMTP id x12mr21215619wjw.112.1431362296630; Mon, 11 May 2015 09:38:16 -0700 (PDT) Received: from panicking ([91.252.193.136]) by mx.google.com with ESMTPSA id ew10sm533875wic.22.2015.05.11.09.38.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 09:38:15 -0700 (PDT) Date: Mon, 11 May 2015 18:37:34 +0200 From: Michael Trimarchi To: Angelo Compagnucci Message-ID: <20150511163734.GA8831@panicking> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] Atmel_usba_udc: Kernel panic in usba_ep_enable 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 Hi On Mon, May 11, 2015 at 05:58:27PM +0200, Angelo Compagnucci wrote: > Hello List, > > I'm having troubles with usb audio on an SAMA5D3 on 3.19.8 with a > strange kernel panic. > > The function f_audio_set_alt (f_uac1.c) is passing a NULL out_ep and > so the usba_ep_enable crashes with a null pointer dereference as you > can see from the debugging output: > > [ 24.210000] ep1: ep_enable: desc= (null) > > Unfortunately, there is nothing strange with my configuration, I'm > trying to use the soundcard (which plays files flawlessly) as a usb > soundcard, so the only thing I did was to compile g_audio as a module, > enable UAC1 and did a modprode. > Please apply: commit 8d252db174ab27485126f540f368149e3c875e5a Author: Xuebing Wang Date: Wed Dec 10 16:28:15 2014 +0800 usb: gadget: f_uac1: update Class-Specific AudioControl Interface Header Descriptor Update this according to USB Audio Class 1.0 spec. This fixes the Windows 7 detection issue. Cc: Rafael Brune Signed-off-by: Xuebing Wang Signed-off-by: Fabio Estevam Signed-off-by: Peter Chen (Fixed some code style issues) Tested-by: Peter Chen Signed-off-by: Felipe Balbi commit 625763d101c7aa706b35f052cd978a61f1ef26bc Author: Xuebing Wang Date: Wed Dec 10 16:28:14 2014 +0800 usb: gadget: f_uac1: configure endpoint before using it UAC1 forget to do it. Signed-off-by: Xuebing Wang Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi and check the error of the configure From 36faa76befcdcc0d273c8cea32fef82f2fb85771 Mon Sep 17 00:00:00 2001 From: Michael Trimarchi Date: Mon, 11 May 2015 18:30:52 +0200 Subject: [PATCH] f_uac1: check return code from config_ep_by_speed Signed-off-by: Michael Trimarchi --- drivers/usb/gadget/function/f_uac1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index 9719abf..7856b33 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c @@ -588,7 +588,10 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt) if (intf == 1) { if (alt == 1) { - config_ep_by_speed(cdev->gadget, f, out_ep); + err = config_ep_by_speed(cdev->gadget, f, out_ep); + if (err) + return err; + usb_ep_enable(out_ep); out_ep->driver_data = audio; audio->copy_buf = f_audio_buffer_alloc(audio_buf_size);