From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 AF1E831E0FB for ; Fri, 16 Jan 2026 23:21:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605680; cv=none; b=AxHgtR7h9jQpIJdGEnferWGAm81sqG2pTQxqKlXdGeGHGptQk3ZWZMBwDceBrTkfo9fEAqQbR4pPItRrrze9rxm5VYsNADvKqNEE51GdLm5QvutD0OfakGY4KSx33nj/1tthNz4sCP+G0azxH8uVv5+2/uPNxidd02w+xVzG/Cc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605680; c=relaxed/simple; bh=jYMZSplTH/Weoy7w2xwkPNIev4l2TEwX13EaENGM7y4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IIjtd9TWRIWMIDirbPCojBrzxQM9V7VZi/xZKDwPstdXoacsPf/mLndEc07/mf2Z4w2Ug92EcCjFwgUylo50uvhjiYgUavY52ZOelbTatvXp1ALBvv8msDq6C6RkSG+8aWb60laTdqqalizmZsD9F/KVmp8nPrVepmiNYz/aBuU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZCs2Y3vA; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Fa8NN4Gf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZCs2Y3vA"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Fa8NN4Gf" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GNCstt2958249 for ; Fri, 16 Jan 2026 23:21:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=7PTKth0UrDe AreEEoorgLCH/1E+7Lkz0YAQpMI46XKg=; b=ZCs2Y3vAIhSwRp2Hfh2X86eqnec Vp0LrLS2Q4rJzkgo6vMRUdnShjXyQM8txvRnalpRx0A85f4v+2gasrlq/nKcv09o LXsKGXJqZcYWkCOWkrSmJfyT9C+0/J5MxYB/pyIqQsnEmhzZwKWuoLxfbsZ6LjuF a11ILSL4iGtXw0LNv8MxbTWUFg+2mtxYNXHzznJ5wVfkTmmY1NCawOLuKSYDfoiv Zo50Gt3eOZS6Nlvp8g1hRwgLpm69fRHLm314Ye1qDwTOCAMyw2/cycbKZGWLnFG/ jln7gCcAu6Vxd9t8OUUDfp50by1fxv0XPIJv74nvtHYWE86jjBvuVmI7nVA== Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvhh8ahw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:14 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-123840bf029so4797932c88.1 for ; Fri, 16 Jan 2026 15:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605674; x=1769210474; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7PTKth0UrDeAreEEoorgLCH/1E+7Lkz0YAQpMI46XKg=; b=Fa8NN4GfJIbM+nJB5tXxrqJmFhkilYLl4U+knmm48DBsxBqbyRPj3RXb9I3slPhcEz 8QPiD7N5DFM9vrrvsoukMEt5ZJW+6xqwxZGPLk3bzUVMgdD6oi5FudforWSqDxk0mZQC QoeJaPDzxiw13Gto8s9HOLZOGzXmNIubnjmEsRkOCaVY/sVk/AjmNApcPGrO3WwYYFAZ kkNtwbm89nHgBEooYrHAVpN2l7gSo8uOLo5u2dh1jQOroV+VpqGQ0li+2kLBdj5ELgJr e/YU77NUrEYqpo7mh+H6+AlM1OOyQgcewr6MF3BM5/kM+Dpnu6mPxx3oXVIolkWNR4Eq 9Yqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605674; x=1769210474; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7PTKth0UrDeAreEEoorgLCH/1E+7Lkz0YAQpMI46XKg=; b=b7ZUdSniAS27a7WYQkcXAfZfXG9whwoy+tWFtQ9EkNYTuRNyniszvpwQIVVvWayfX2 Jy7N9MBOHqzgbRLt7+f6ZMUbmGS6oPu9bbblwxhQJxCRergRsJaAy0LtusojunF11NWx SbLITWBMEn/i9H0jTs7YrLglWsbKep+Mj7SbpskXxGQZ6B+9yOygvn4RcPEA2PjWDdTH VWiZ2cbvQTo1jfMFYgRkXBxZn3p63z/OhoAjhyw9Jy9mzFM1pmTKsJgad9mb+D9itklL XyHVvpQEQslQmb8Z3/6yIS+F0CQLbdcVF9rsFqqezZ4O92IsZoDsi7v3rku+7UnojbtT 12QQ== X-Forwarded-Encrypted: i=1; AJvYcCV50KQuj4CBvFyfxV+JpXY33otcIZaOmF6u73MDoScKOQndAap/7xma2NLAj/xDP1FZQWrKY6FhWYr73UI=@vger.kernel.org X-Gm-Message-State: AOJu0YxpRxU+57K2S4Ap+rnmUQc7hRBOghFL9ZSFTuwqpRe32NIO3gYz FxxoAzqyWtOZ9vYuGpdDXCwU2Z0aUV64vx3N76XrmREF2nVeQyHPrFVv281tke0wM1FaIA/3e3n fI6lTv8KPm7A44Cl/3FL9+k1oxZT41Ng+bY+kEfANNZplT3veJdYHBvGRAhofRArF7So= X-Gm-Gg: AY/fxX6reXBrUpeSKKrpeCVugLUIIHLpAAhu8by6Z2wziQUnVy3UiLGPLZlmBywsGbI 4Ugs1Kk8irDGzKAbNMmtyUzodpgemEJ0CfumyxQcZR1JtQ3SjBnswGMuEatSxlChrJPQx5pZ4L6 EfM/qx5c+M90kYrrfVGI4WXjBG+2Gd20JD+/71eEhpZm070QdsfZNNfT+HKfDgjCIzNopF5+Sau xJcdjkzGUeEbSZUjEIfbSXt9u+9JCOMhc4AKjhgrxrCovvhsBCdb4qATNP79CZnLZIWkxvPs/od VeNdL9Mp2Es3D3HX18wDgMmnlAEJRzgn9VqrUBuw2+4x8uzls8fwFmzdZrVqMsJyjAkyjh3oEH0 yvx+vAzOcG96NqNywrACI1G0uHZFCjIwuMqVjSAay0gsEqrTzxdVfBmVTqe3DNsc= X-Received: by 2002:a05:7022:4190:b0:11b:9386:a3cc with SMTP id a92af1059eb24-1244a78115bmr3483074c88.45.1768605673620; Fri, 16 Jan 2026 15:21:13 -0800 (PST) X-Received: by 2002:a05:7022:4190:b0:11b:9386:a3cc with SMTP id a92af1059eb24-1244a78115bmr3483059c88.45.1768605673137; Fri, 16 Jan 2026 15:21:13 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:12 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/9] usb: misc: qcom_eud: fix virtual attach/detach event handling Date: Fri, 16 Jan 2026 15:21:04 -0800 Message-Id: <20260116232106.2234978-8-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: 0JnTfZrPeWsg5aZIL9uQYOreMKy1_qsA X-Proofpoint-ORIG-GUID: 0JnTfZrPeWsg5aZIL9uQYOreMKy1_qsA X-Authority-Analysis: v=2.4 cv=foDRpV4f c=1 sm=1 tr=0 ts=696ac7ea cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=oDIJ3hVRoRHbvujwG_AA:9 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfXz9cI9FjA+Oki xlPwlYRQtD0tBavRbD9szKSCweu/noaPq69cygjkt2LkepNS2bYoundPGs4nSrzVl5YW2ltmtlg EGbcF0LDtISBuI8S60HaFKnrwCBUgGLzGPelKggZuL12vaewClrFvv0P9hfw843ufQ4x5+lT5Na dxPbDvqLoY5NJyVRSl4CXCTHwM21G78uirnry78U4MQIEdbQmG5pHc+ugw5+EjyecKvayYMaUqq vSZJWTeHJPACBjAyKFJI3ePILU140JDbqevSaoL1CwiE3E80GKAukj8mfW64EX1JL8yyQChQ5hN TXg0ZoZGJastIRBHNJwgfZrfP0kVzSATnCNX2a74Xhb0JJ6KaZR/ZVm8mUCbSKzTRjE+6vO9yFh cjvzE2m8w9UgiuutsRg/W+HbaQwhQ9zb4/a6X4yeyl5ULLIAltVEkXG/x2cmSXwM5n1H1i5+elY YNp340go7vKOA1qBy4Q== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 EUD provides virtual USB attach/detach events to simulate cable plug/unplug while maintaining the physical debug connection. However, the current implementation incorrectly sets the USB role to HOST on virtual detach, which doesn't represent the disconnected state. Fix the virtual detach handling by setting the USB role to NONE instead of HOST, correctly representing the disconnected state. Signed-off-by: Elson Serrao --- drivers/usb/misc/qcom_eud.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index 3f1cc7ea2a6a..60f566427abe 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -343,10 +343,26 @@ static irqreturn_t handle_eud_irq_thread(int irq, void *data) if (!path || !path->controller_sw) goto clear_irq; + /* + * EUD virtual attach/detach event handling for low power debugging: + * + * When EUD is enabled in debug mode, the device remains physically + * connected to the PC throughout the debug session, keeping the USB + * controller active. This prevents testing of low power scenarios that + * require USB disconnection. + * + * EUD solves this by providing virtual USB attach/detach events while + * maintaining the physical connection. These events are triggered from + * the Host PC via the enumerated EUD control interface and delivered + * to the EUD driver as interrupts. + * + * These notifications are forwarded to the USB controller through role + * switch framework. + */ if (chip->usb_attached) ret = usb_role_switch_set_role(path->controller_sw, USB_ROLE_DEVICE); else - ret = usb_role_switch_set_role(path->controller_sw, USB_ROLE_HOST); + ret = usb_role_switch_set_role(path->controller_sw, USB_ROLE_NONE); if (ret) dev_err(chip->dev, "failed to set role switch\n"); -- 2.34.1