From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85C7F74BE1 for ; Mon, 23 Dec 2024 06:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734936681; cv=none; b=iMhufCfjMDaI6Z1S2vk8CQqGmmMxGZ7jrO3Ezf99QpHWvc/OZCDqDDH9bbGPV/KMkDhmMAe3a06lrJSU2CVbelopj1sqkX5CxK2P57qHEGAwbfZYx8iNekGNcHNEaGHVmMijcj7B5V+PLVIv1e7atasyiqmPITGJWQK/5SNWoao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734936681; c=relaxed/simple; bh=94i8KslI8aeZKLYfNFgGgE1M6Yy0Uvg61pidEufkasg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=RmFhYi2w2sgZRv95Bn/4/Qcms6X/ug9Cwg/sRTO+wn9YZ63nib6Ontj8vWki3qQNNi4n+fTa0BaUPUPJFxrglbxTYERPgOMSJg6TgDfYDQrecbofMwHtcSUhwdHFITZr6PjgP7RIY8pq/YAVbF8mXtXb8B17aSrKxUV4OOPLOJ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=fDjznOGO; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fDjznOGO" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso23339145e9.1 for ; Sun, 22 Dec 2024 22:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734936677; x=1735541477; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=94i8KslI8aeZKLYfNFgGgE1M6Yy0Uvg61pidEufkasg=; b=fDjznOGOoSBA7COCxNcXGA3pjkugoh0budfRA7rFNLz0VMv1wC4kGH5LulRw/27aOQ xk51H+UfmejsNqtLGtDnSd6OmKhtfF00PNbzzrijxm8g5tVtMPswBw3sfYr0qyuy43rr /me++/ERfARaJZniC8UsaUHp90DcPmM5EDMnZsezquMLstdtP/WgLq/7NvO2FfgMsQMf PJsO8qVOuoj5dZbl6L1d6RrAg2v68xlCcj1SNyDfvynfZecc3+JnIR5b9dx6apijZ6d6 l9MH/W0vFzpOywcjMWZXXww6onWd1tPWd7ojCusPuYrPgK7UHJEQE0qziyeMTumfBMKY arVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734936677; x=1735541477; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=94i8KslI8aeZKLYfNFgGgE1M6Yy0Uvg61pidEufkasg=; b=J/8WXcrtbsjGxpfI+ZpDWKJJl9nTUlDOYSFkOqwW8d/Pgu639aUzR/Q0iTi1Kiqr3p 4wbdfu++c9HwIPdSSwB042McuASy+OOZVaD4daA2LB8UHBWMCT+DW1dtfCUKi+uf+5S6 V5Vpybh29rnjjlFAwMX4/XivxYKhLrwwDPnZns6+ipeNRqNNIDHglM3gB7UhJvPnU452 aBCBGNJJBHP4YsLCPr+pdUom0TgauIJOtMwNI3vhU591zTq0bKIzt8ZZGE9aV/+ZAomO PQNrnjpahASYpmBbG1KnWBNw+X5y2jqS/zp2ltX+7gdnYP+7DLkUgpY9IC3jbSZWG0D4 Le0g== X-Forwarded-Encrypted: i=1; AJvYcCWjQQhx1UPrG+f/vfCGzmtUmxOrHAy2lVCTw3uNZmdndglIKaEBkEvHAqPjrN2nU2j03eKXT0Jh+tdvWec=@vger.kernel.org X-Gm-Message-State: AOJu0YxyrO0X3oN0ZaAf9mz8N9ftD3OANMajKWbnfdPbDSHjCmUzchEE XGWrzsxdD/PZ7SqnTIse4kUFRO2vPN20fmiSFjMXG7cfsHvvH0M7TgldomaF2T8= X-Gm-Gg: ASbGncscLDwns926SztvPdfWPNhl5/BrAmcS/TIEgQY+QLOInmKYtxFnEaBrWg0Rqfy DdIySm9XZw8oGsL8a2cv0BLZTuilG2o14YwgRyeUcyfLR9OTR+NiAh5BMkSlHPAg4W4pQR2PhVK UA2sc7aRh2ifn2t+XtV5eLXT+2BW59Smuq0cW/nVTNozV7fF06I6KhijEUzwNt6BI5qMHFi7v2r BR8pzIoHEDPZ8Nxqrbh1Y3cliYvDGguXHZWDAVCuRnI26v8dqcZVmg22TU9pg== X-Google-Smtp-Source: AGHT+IE13LdaAP2755/xgEGMuzrqta7sgVdxQtIcT3qYeIdk/H0kVEWtm6wQRpY6hkB3BXnsbwQ8Ug== X-Received: by 2002:a05:600c:3b8c:b0:434:ff08:202e with SMTP id 5b1f17b1804b1-436699ff9famr94807705e9.8.1734936676782; Sun, 22 Dec 2024 22:51:16 -0800 (PST) Received: from [10.1.1.109] ([80.111.64.44]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b3b2a4sm159529915e9.27.2024.12.22.22.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 22:51:16 -0800 (PST) Message-ID: Subject: Re: [PATCH v1] usb: dwc3: gadget: Fix incorrect UDC state after manual deconfiguration From: =?ISO-8859-1?Q?Andr=E9?= Draszik To: Roy Luo , Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: badhri@google.com, peter.griffin@linaro.org Date: Mon, 23 Dec 2024 06:51:15 +0000 In-Reply-To: <20241223042536.1465299-1-royluo@google.com> References: <20241223042536.1465299-1-royluo@google.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.1-4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2024-12-23 at 04:25 +0000, Roy Luo wrote: > The UDC state in sysfs (/sys/class/udc//state) should accurately > reflect the current state of the USB Device Controller. >=20 > Currently, the UDC state is not handled consistently during gadget > disconnection. While the disconnect interrupt path correctly sets the > state to "not-attached", manual deconfiguration leaves the state in > "configured", misrepresenting the actual situation. >=20 > This commit ensures consistent UDC state handling by setting the state to > "not-attached" after manual deconfiguration. This accurately reflects the > UDC's state and provides a consistent behavior regardless of the > disconnection method. >=20 > Signed-off-by: Roy Luo > --- Reviewed-by: Andr=C3=A9 Draszik Tested-by: Andr=C3=A9 Draszik