Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13912100pxu; Mon, 4 Jan 2021 07:47:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJynIfacpZOmbtQV0MKv47pO0WxUS0ThDZ77rmiGh8biYm7aZCvsFsJ1KYC18FLWRFU1qNIV X-Received: by 2002:a17:906:fcda:: with SMTP id qx26mr67818290ejb.213.1609775263949; Mon, 04 Jan 2021 07:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609775263; cv=none; d=google.com; s=arc-20160816; b=VC2NBT5m/V1D7tkhkqN7Lx+oyx43qxUtKMiBflGCAZw0e9NqPtp51De9Q4xNT3gPqp riICIDu219Rbyso42OjTeom8z4CI/IaFupkyatc8y+rIcx+ophFZinUkWMUCOyy5D3k8 aDXgiJ2q1Z+dEZ4EvnCojmnP7cqdoV5AJQhRRGcTyv4bh+AGmVhvqjpw+Uj25RrlSpsr BDd1dOJX/twWvkghnjlEV5U5dkFCA72jF+r58QtKwX5iOPW/KYlyFj9rdGBoopxM/39v OG89jTQEB1rFcGejVcvlyW3kKEVFGGzOU6ePtiCC5TCQ9rHLvTDN8QoiXrkNivkOvaqT yLHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jNJ7e7ycZ3Q1g8z3Pl5OTzqXzQJ/KTkHq1jsGm684Xo=; b=zZLoLNABT4I4OLWOChVt+4ILLkR9q3okCkcDpvNi9ADnz140mDhFrGMzjr3wShRxVy l0RlHk+7v1/PTJXPNxv4f+sgA5/zU0lTu3PT0w3sJNXO0DyTREMakbzD6GyIzgwBBxB4 tu+ObBERxVqEbUtAbqzkzCur4gEwO6lSQMec2TxEOCwBkHx+Idx/bU4zWLVYi8F+L+Ru udU6td3qDQehHGZTcOLMxfMyhmgaMSyVzgkPEacXAqbVkdHu7R2kLJ9HWV7igbuDxMQX TuBC98sspnzyjvTPR0Kg7FN1jV2T8aq/Dg8Ic439s9aaJzs6Q3x2P34Ufmow4mYDw7h6 kF8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1f0eu/os"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si28328503ejt.198.2021.01.04.07.47.20; Mon, 04 Jan 2021 07:47:43 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b="1f0eu/os"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727730AbhADPog (ORCPT + 99 others); Mon, 4 Jan 2021 10:44:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:33008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727676AbhADPog (ORCPT ); Mon, 4 Jan 2021 10:44:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 244DC21D93; Mon, 4 Jan 2021 15:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609775035; bh=oIOdn1cm925hl6iQ2ChQ9l9kj2qYpDJe0fL6Dgbb3Ck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1f0eu/os/MNFRHTy/JJPoEHRRRqTjVqd8k5waO/a3d8VyefOZXuXx1qDzc9HA0SCd qlRlA1pF2NFiqre0fBL9ZbMDVBncEe0mf+8/TyuHEjtEoQiA8fENwO1E1aAz/GKrzA vbjVqZGPeESN0i/yVb61xj/VIal/1mDKTo915Ces= Date: Mon, 4 Jan 2021 16:45:21 +0100 From: Greg KH To: Wesley Cheng Cc: peter.chen@nxp.com, balbi@kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 3/3] usb: gadget: configfs: Add a specific configFS reset callback Message-ID: References: <1609283011-21997-1-git-send-email-wcheng@codeaurora.org> <1609283011-21997-4-git-send-email-wcheng@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1609283011-21997-4-git-send-email-wcheng@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 29, 2020 at 03:03:31PM -0800, Wesley Cheng wrote: > In order for configFS based USB gadgets to set the proper charge current > for bus reset scenarios, expose a separate reset callback to set the > current to 100mA based on the USB battery charging specification. > > Reviewed-by: Peter Chen > Signed-off-by: Wesley Cheng > --- > drivers/usb/gadget/configfs.c | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c > index 56051bb97349..80ca7ff2fb97 100644 > --- a/drivers/usb/gadget/configfs.c > +++ b/drivers/usb/gadget/configfs.c > @@ -1481,6 +1481,28 @@ static void configfs_composite_disconnect(struct usb_gadget *gadget) > spin_unlock_irqrestore(&gi->spinlock, flags); > } > > +static void configfs_composite_reset(struct usb_gadget *gadget) > +{ > + struct usb_composite_dev *cdev; > + struct gadget_info *gi; > + unsigned long flags; > + > + cdev = get_gadget_data(gadget); > + if (!cdev) > + return; > + > + gi = container_of(cdev, struct gadget_info, cdev); > + spin_lock_irqsave(&gi->spinlock, flags); > + cdev = get_gadget_data(gadget); > + if (!cdev || gi->unbind) { > + spin_unlock_irqrestore(&gi->spinlock, flags); > + return; > + } > + > + composite_reset(gadget); > + spin_unlock_irqrestore(&gi->spinlock, flags); > +} > + > static void configfs_composite_suspend(struct usb_gadget *gadget) > { > struct usb_composite_dev *cdev; > @@ -1530,7 +1552,7 @@ static const struct usb_gadget_driver configfs_driver_template = { > .unbind = configfs_composite_unbind, > > .setup = configfs_composite_setup, > - .reset = configfs_composite_disconnect, > + .reset = configfs_composite_reset, > .disconnect = configfs_composite_disconnect, > > .suspend = configfs_composite_suspend, > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project > So this changes the existing userspace functionality? What will break because of this now unexpected change? thanks, greg k-h