Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3812305imu; Sat, 24 Nov 2018 11:30:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/WOZ1AxFzx5b9K3tPwaDJP5MoHhbXzoDuHRSZA2SBou69jSFqDNutCbBf79sNXQURuRU9t7 X-Received: by 2002:a17:902:14e:: with SMTP id 72mr8368233plb.287.1543087836826; Sat, 24 Nov 2018 11:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543087836; cv=none; d=google.com; s=arc-20160816; b=wUgc5ojMFi7ukoa7qUkiZKyamoocZVV5lHkFi1Dk15Wp3XjrNpfx9y0oPC8w0ZQ9TS 0XI0UzsfDutO6Oag4c22jXRpSOsFr6bh5XBva+OUcNF8fyrQ25XNH8fOoc9OAALpVqe9 lm+nO6XC8zJKv3q5Qy0bghUAK95sGxA+xuYNLtVQijAE9/3eEGqkrQsZexXcYqvMNlum xmiEysyu6dmFWMwOsUQMAzH4TUiws0UoriPa7fXTa8LqiYCvkOr3toXLpF99C22L2zwJ 4lE+wS+9R0br/N4q81TuVVUhkkYU7kOAS4xrNWQfMN2XcunN2mo1jyuoRXlG91YXQ5Hz 5HbQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Y7BhvAviZeKkaAIktEN1o690B3U3u8nUksuY3ADWplo=; b=FKdp0Wlber98lHSIe2sgjRpnJvnrDvNNoRDK+ZDLTaZEoORdef0/Wq90rNy3xguuAA qtPCmxpRYOoRL8X3wpJBanvCqUDgVfIAWvbxNf8kLHCTs4X4kUWJExH09DaezeCIN7+g pvrmDIHZtnpFCfKrSPaqtYj4CzgEuUNHvu6+0K7N2/EIidt3Adi1KBxbJLx4yeLX+SkF 0w/NolV3pNvR63y/n8PfYxN4TWhpsj1LhEoNJaa1AZG5aKcL92Pi4avyqAcea/g+3g4n 89/+QpOUvjXqUNMzGNM6Rn4kt0CLSfCSdEWgyT/WPn4MLNIZ3QcYkLN4HXv8Ttz2ayF/ 0ryA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=avxU0T0K; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t136si32565647pfc.262.2018.11.24.11.30.21; Sat, 24 Nov 2018 11:30:36 -0800 (PST) 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=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=avxU0T0K; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726165AbeKYGSw (ORCPT + 99 others); Sun, 25 Nov 2018 01:18:52 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:43062 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725738AbeKYGSw (ORCPT ); Sun, 25 Nov 2018 01:18:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y7BhvAviZeKkaAIktEN1o690B3U3u8nUksuY3ADWplo=; b=avxU0T0KZK6QHlwyjKCoGsqaV hV3QeFpSL7DQwdUJN4gtrDQCujqTnfML9ZjERjYAyLrdX63CwiJcPSs/r+PDQuor6/olgcWvnZLni p5jt5oM12GZTbyQ0Iz1XknVDa+q+R6ZYEGeGNV1lEeYOQLcDtc/zTrSelnM/ewaLYBicg=; Received: from n2100.armlinux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:47876) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gQdcS-0006bi-QP; Sat, 24 Nov 2018 19:29:33 +0000 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1gQdcQ-0006vC-0O; Sat, 24 Nov 2018 19:29:30 +0000 Date: Sat, 24 Nov 2018 19:29:28 +0000 From: Russell King - ARM Linux To: Aaro Koskinen Cc: Greg KH , Peter Ujfalusi , vkoul@kernel.org, dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, tony@atomide.com, linux-omap@vger.kernel.org, Felipe Balbi Subject: Re: [PATCH] dmaengine: ti: omap-dma: Configure LCH_TYPE for OMAP1 Message-ID: <20181124192928.GR6920@n2100.armlinux.org.uk> References: <20181119104040.12885-1-peter.ujfalusi@ti.com> <20181119184649.GE16897@darkstar.musicnaut.iki.fi> <6af8c6e7-bf5c-5555-161b-5d3fb7ecae43@ti.com> <20181120210406.GB24888@darkstar.musicnaut.iki.fi> <4eb3b03e-0a97-6195-f162-e03e32705fe0@ti.com> <20181122220114.GB11423@darkstar.musicnaut.iki.fi> <20181124001740.GI12912@darkstar.musicnaut.iki.fi> <20181124174823.GQ6920@n2100.armlinux.org.uk> <20181124190648.GB3416@darkstar.musicnaut.iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181124190648.GB3416@darkstar.musicnaut.iki.fi> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 24, 2018 at 09:06:48PM +0200, Aaro Koskinen wrote: > Hello, > > On Sat, Nov 24, 2018 at 05:48:23PM +0000, Russell King - ARM Linux wrote: > > Hmm, there's more questionable stuff in this driver, and the gadget > > layer. > > [...] > > > So, whatever way I look at this, the code in the removal path both > > in omap_udc and the gadget removal code higher up looks very wrong > > and broken to me. > > Yes, week ago I saw omap_udc crashing on both probe failure and > module removal and sent some fixes for the most obvious failures (see > https://marc.info/?l=linux-usb&m=154258778316932&w=2). The effect of your patch is basically to replace the release function with a no-op function. > Is there any good driver that uses usb_add_gadget_udc_release() correctly? > Looking at fsl_qe_udc.c and fsl_udc_core.c they should also crash if > usb_add_gadget_udc_release() fails. usb_add_gadget_udc_release() itself will call the release function automatically on error. The release function should _also_ be called when usb_del_gadget_udc() is called (and would be guaranteed if the memset() is removed.) So, moving the cleanup in the remove path into the release function would solve the problem with omap_udc, and removing the memset() would solve the problem with the core code. It does leave a problem if the omap_udc module is removed - the release function _could_ be called after the module has been removed which would lead to an oops. That's presumably why there's a completion. One solution to that would be to move the assignment of udc->done before the call to usb_del_gadget_udc(). However, using a completion for something like this tends to be frowned upon, but I don't see any other way to ensure correctness here. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up