From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 144DF3CB2C1; Mon, 30 Mar 2026 13:15:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774876522; cv=none; b=QPlbhSpkYmJpGMq4xqAMKWLyi4P9DMMaNgNHEmiHMPD/pv7e0CwBJdmG2/DnNvYLzEERAUH8HEfCU2giaUMGyp2yZNZsqgwuIJ1c0lEeB0NnS66PHnStQb8D4nOX8cF5ICYkJbfFo3fC1b4rYDVd+SLJ+VcLickhhRJxmojrFNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774876522; c=relaxed/simple; bh=b1haNmzh5GBu/xqCNhbwf9cQMSb0Kbt+fAjPReEkhGc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rbFa5N0rLrnVIM4F5yy7xlWDLpD7AI0hFDmT5/CysfbfJbpCnJ6CJ9him65R9RQzymn/26Fw/joar/wGtipmFJwZsjT69eg0SnxWMeUvr5H3VcU2RMi8IIeDIKkg7jgPW+vmiODMr4xP2VCXfFA5hbYCCRJQ9pn2ZQOqbNkeO7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MneS+9H3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MneS+9H3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24BBDC4CEF7; Mon, 30 Mar 2026 13:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774876521; bh=b1haNmzh5GBu/xqCNhbwf9cQMSb0Kbt+fAjPReEkhGc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MneS+9H3YIhbaR1Cnk/kcZy7hXMELM+aGTZ6lmJBo5q/Kp3SahX68xyx4Zn9iX8z7 SX0oZwi3eaVpSvnaaA8p2U7+VZTQMqL/S1wkp8RIkCpKvPAa2593mDJwYN5bEIYrOj zHchgJDuFu88lVdLCb8Bf6lXLDMEIBuBOT7YLBfs= Date: Mon, 30 Mar 2026 15:15:18 +0200 From: Greg Kroah-Hartman To: Marco Felsch Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Fabio Estevam , Matthias Kaehlcke , Liam Girdwood , Mark Brown , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH v5 1/4] usb: port: track the disabled state Message-ID: <2026033002-cyclist-onslaught-30ee@gregkh> References: <20260223-v6-16-topic-usb-onboard-dev-v5-0-28d3018a8026@pengutronix.de> <20260223-v6-16-topic-usb-onboard-dev-v5-1-28d3018a8026@pengutronix.de> <2026031105-uptake-glucose-5b61@gregkh> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Mar 20, 2026 at 11:16:43PM +0100, Marco Felsch wrote: > On 26-03-11, Greg Kroah-Hartman wrote: > > On Mon, Feb 23, 2026 at 12:27:34PM +0100, Marco Felsch wrote: > > > The disable state isn't tracked at the moment, instead the state is > > > directly passed to the hub driver. Change this behavior to only trigger > > > the hub if a state change happened. Exit early in case of no state > > > changes but don't return an error. > > > > > > Signed-off-by: Marco Felsch > > ... > > > > #define to_usb_port(_dev) \ > > > diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c > > > index 44e38f922bc553adee64b35c536dfd4154a42d8a..86e9d6d0c0f505782569565fde8e4a46b06b8b4d 100644 > > > --- a/drivers/usb/core/port.c > > > +++ b/drivers/usb/core/port.c > > > @@ -117,6 +117,10 @@ static ssize_t disable_store(struct device *dev, struct device_attribute *attr, > > > if (rc) > > > return rc; > > > > > > + /* Early quit if no change was detected */ > > > + if (port_dev->disabled == disabled) > > > + return count; > > > + > > > > This will change behavior where someone tells the port to be enabled > > again, when it already is. Is that ok? > > That's the whole purpose of this patch. Can you please elaborate why > someone wants to enable or disbale a port more than once in a row? I have given up trying to understand why users do what users do :)