Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1486124ybm; Sat, 30 May 2020 10:18:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwv4boWju1x+llkfL7+We7YehEPJajK8bXgBYEBYqLloL43Y5Ikal/LKd55rihL7dKqivhT X-Received: by 2002:a05:6402:690:: with SMTP id f16mr14432255edy.9.1590859083087; Sat, 30 May 2020 10:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590859083; cv=none; d=google.com; s=arc-20160816; b=sms2gOx5i7CSjAjMFna1YtE51A64wL6QEx1lngsdia2orFxhOizNRE1jv6IUn+mRro f9GHQy06x1DlrMHvzx3HT8zMM1VeQkVMHLoyxcYLd2jiDzmobViSYxh5Nkwevf9Ba/W8 J1dRb0Zv5KnZEg9vo4enaDZujVVA687yZgD+tgj7gD2tEDKY4Gzeg6p4dRqyZs+jIv1L +kcHonp05cRkrPYoYDyJyohaRSRBRfuO00ytwMHS8JksftTzTKLG/aL6ENxycTyRGY45 225dGynkv21mbkMmzC/0uonEo4Ctm6Wm/Idv/3dilrMTx4S6WttSVaVGwcXXD6fKZKuc f/2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WGnXi5QcyLufOi5G2IOZIbzJpQ/KwBmVElGBbx8pXc0=; b=C9LxCnn4jQDurIk/S+mJWTG9vUMmVONY8c/W4YcvxwxxU8Rbqk3EhD2Bvi5pT2DMHz B4G6akBOuB7MAl2x+/M4cGruZvNQJcPefQfpnriiGlp2xFktm9Q4DO8CB68GNr1oO+ep Y9/fxPcDw/alDGyWXNOQTwMqHy4FHRMTFVV0xCH5+qPdf1ucGb4h+52JM8dxSiscTYzK 1BGzGTK/ciJNRaB3QKE7RdIylnzT0eq5vnJ8Kp0e6OqVUhn7EblzYxOTsVgbCfQn/kxq IWtF82/CRCbiPcnRi33HXsly117rtZdMpRWTPZz7aOah6wQZBFylhaz+RgOuMwUpfhai GNOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=IOSBYLRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox12si3462188ejb.565.2020.05.30.10.17.39; Sat, 30 May 2020 10:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=IOSBYLRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729188AbgE3RP5 (ORCPT + 99 others); Sat, 30 May 2020 13:15:57 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:9738 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728927AbgE3RP4 (ORCPT ); Sat, 30 May 2020 13:15:56 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 49Z7PQ0Llbz6R; Sat, 30 May 2020 19:15:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1590858954; bh=Z3I4iqZssynvHyIKkwc6iDvd5nliuSp4CpNF2Pe2wjw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IOSBYLRusv3Q/rjMxE1zs2NN4DEyNHJGK/TmI/Pn73IjzqCb6n9BeQbySI153D5Of /EDPJmGkaNznqiFa+bv6jj4gH2kAMt4Z0U3DiHypy2RlaajEwXoxVbvv95lUYdGeqC uDhDzQpqBm2HA+arpNXgw+11Jxyqhx8z9sLbHpTIqFMao6kPRt3E2jdQrpbrLUrbBP 6YmTxTtDiyKfzPmoeFi4czir6i/1Eh6dal0C0tOow1zhQ2PJ0Fnavd/hNcV36QIrOm mK2vqSes+ekR/yE3VBQLDGPOUkZzmR+DhGscx4q0GAE3rCvQ/kM81JuwRQJC3pisd8 aw7UAjoOUmqhg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at mail Date: Sat, 30 May 2020 19:15:52 +0200 From: =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= To: Peter Chen Cc: Felipe Balbi , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] usb: gadget: f_acm: don't disable disabled EP Message-ID: <20200530171552.GC16333@qmqm.qmqm.pl> References: <237e4bc8c63680f9ce0388d35b4c34a856ed8595.1590690518.git.mirq-linux@rere.qmqm.pl> <20200529081104.GD32755@b29397-desktop> <20200529135524.GA14614@qmqm.qmqm.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 30, 2020 at 01:03:17AM +0000, Peter Chen wrote: > > > > > @@ -425,9 +425,11 @@ static int acm_set_alt(struct usb_function *f, unsigned > > intf, unsigned alt) > > > > /* we know alt == 0, so this is an activation or a reset */ > > > > > > > > if (intf == acm->ctrl_id) { > > > > - dev_vdbg(&cdev->gadget->dev, > > > > - "reset acm control interface %d\n", intf); > > > > - usb_ep_disable(acm->notify); > > > > + if (acm->notify->enabled) { > > > > + dev_vdbg(&cdev->gadget->dev, > > > > + "reset acm control interface %d\n", intf); > > > > + usb_ep_disable(acm->notify); > > > > + } > > > > > > But it does not fix any issues, the usb_ep_disable checks 'enabled' flag. > > > > It generates spurious trace events if you enable them. > You mean the trace events from core.c? If it is, we could try to improve it > and indicate it is already enabled or disabled. It is indicated in return code, but the problem is that this generates noise and wastes debugging time. The problem I was seeing manifested itself as disabling disabled EPs and desync of EP state between core and UDC driver. The patch avoids the noise and makes the code obvious. (This check was there at some point in time, BTW.) Best Regards, Micha??Miros?aw