From nobody Sun Apr 5 13:19:41 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 CCE4836A02F for ; Mon, 9 Mar 2026 20:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773088433; cv=none; b=iT3dqVW9KqOL4ueGo2/2vKHJVIWcqtQcHozqQFz+y2IK9FxbzO5n52rl21XZHL/oWMPPmirh3N149JulXPjNpbVQFwpUefMgvtIhi/qWPbRd/RWKlfquneAoGf2a7G2HrzXNt6Uummmx0XYowEa7G820djaHJMS151Kr8gvgiOU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773088433; c=relaxed/simple; bh=iR9FBVRNdBPKUJuF0gdJRHocxr70Pd+iL3Ur6tNvyx8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Lkd3PxEA67rC6T22R/A2z/FKBP+B4Od/EABXcjIfjWHIkfGfEm9z06S8HZhDK47KcU3b5qkpobAyjX6B+MEsU1wlHeuadf2BpezCN3P0dj/IG01MZEduDQ0YSFzmAMJaoHNEaAAJ+8r5BH1GMCHGuXon71qV3SLk1K3jNv8zx7g= 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=kvlMvyGV; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iDNRueHp; arc=none smtp.client-ip=205.220.168.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="kvlMvyGV"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iDNRueHp" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 629HC6YT1203810 for ; Mon, 9 Mar 2026 20:33:48 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=6aSf9RIHhE0 ux1aAmM2DjF7m6jzh28AeMG4simH1BJ0=; b=kvlMvyGVnIOq2Nbqz48K1o+SloW 5bN4LqbAhvHIayeWjrUzduAq7bl+Pz5sa2QX4PbefpArctiPI+nArD1jpgjD75QG 6u27c8hEWsTJPgaI3+UEgUDQIwlBYSkZX8WgO9UDJCnglXOTEqoRPxzFGVUOdefm LC4tMrKgr+JLaXzPFhC1v8UJKXyr8QeeRiqwi5McBfGj1wA11wKvgGFrSqVgAH4j qyHohRHVGxAFSg4SVrpIfaaQ5SdLSmz/wcDpTmwQz3aidZ8GHxvP6i7tAokKDeOB lzldC75OhdApJeF357E4ZE1UhlUevWeBGUL77SJ7tY7JM1LYKKN3aasTokQ== Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ct03299bu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 09 Mar 2026 20:33:48 +0000 (GMT) Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-7d4d4db1523so54438511a34.1 for ; Mon, 09 Mar 2026 13:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773088427; x=1773693227; 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=6aSf9RIHhE0ux1aAmM2DjF7m6jzh28AeMG4simH1BJ0=; b=iDNRueHp49/krD9OgsUK5Pd6sDh0swG+xfpl2agIbFA5m2H70QKaOqEolX3c00uwe8 hhFbykPG4OUJ6RF6DQGmFOO8+iAWyh0/XPEyKsg/xXsoWyFSZj2pKMHmcCulD4kOqQNy B6zFsVMn0LAj/yOfiivtooKwlQutskUwXXQaITJKSvpHnWE9pxRjhySjS5N786CcmRiD Jl0cl917pZtkzDyE3BtGiS49o83IBnwbngwZ7FHjPxfkXQrAH5vgMER8V7gbiILUrWvD v0wupt3r2XeZfBvfQQhn0QNkSWICKP0bY1n96ro+yIdxk+lIHkXxnjBMr3kCLSFF8ILK gPIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773088427; x=1773693227; 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=6aSf9RIHhE0ux1aAmM2DjF7m6jzh28AeMG4simH1BJ0=; b=INknzf8iJ+2TMsD9EutErClVDVmEEKZdGfXIuotuYwk8BjJpB6297XCJAu8Ex3kbdj Qq51Zu65N8BxNo5bHdDL8hJzxSBmDevNYm4tKysrz/+pu2scazZN1QxEbppM5bXJDzWv Nlr+MHoNsFdpptmI1QlqfZzRQRkK7YzfnISIUctieiA4UUpaDxaIoXwtqKtY1oV7entT zAkwrPfTz+pkBIw9J0OcF0to2+lk+WgiF39v6YlpReX4/myhqboSehMlD85cZ8VRtgwr uzUXybHKSdFnY0+P7p576Dnsy1y1NmpDJhGJmAeBG76MnRiIC5Os6Yh/BF0112MoTCAN bymQ== X-Forwarded-Encrypted: i=1; AJvYcCUQV2Fa1L/YOCwemG36wiPI+HvUIU2BLJblwdk0AhaHusP0u/Hqw/9zghavCR5lPPTPc6HpWC214jEYwoc=@vger.kernel.org X-Gm-Message-State: AOJu0YxkUrdKatHYcWShkQZSU9ewk56ZHqPe9t15taPK7c8Jo0TH1VvJ YTPb1OsXeHfdaKWNfAwoQSk11dxP9Utm6+yaRQBpDQcCPdrfhPJdcnM1T4dn5JxMtEs6rX/g5c7 3aHjiQBMBI5zSb7fkUkRmkUysPOAIZ/CHaUQe7IS8+/U4wMxhLFV5kRlerN1UZK9uGik= X-Gm-Gg: ATEYQzz3XdRJD0P7keFVPgm5kbI0Ts7VeNVdWyPkmNgjiXHDGDcY+n3RK29UB8PuaNR rRbEbq3Afmab02Ia7sFTsyuvRJ4SOcGJYA3J4Wzi1BNvrnOF5bHS/pt7ujx5XO9Qbnh9/LJF+Y9 nSY0Wpcp4FukDrNJDZ2f1iLVIFPPbZ227QNRmA9sXl+Q0tFnYEqQGJHYjP5KCWE3fv6TX92PT1D RReJN15X/ijiYwJhd8YW2cmuNtgugygiWilChmOPtF3tqfEomltou7c4JuyWv9nBTy8Yxh0NQVx xL66ted9OVE3FbD/frpLdDcGRRY3M9JkozwVJSIig5EU9a95e0NAulD5p3SviUbSiQ/zdO4hbNK hkIwL/DnCyVBX5oE22POtts5h1P6P11sMwPmQts9FOrPdfeGBhxzNP5kcVA0F0AgVU651FWxK2o s= X-Received: by 2002:a05:6830:411d:b0:7d7:4639:440d with SMTP id 46e09a7af769-7d7463947damr3864446a34.6.1773088427362; Mon, 09 Mar 2026 13:33:47 -0700 (PDT) X-Received: by 2002:a05:6830:411d:b0:7d7:4639:440d with SMTP id 46e09a7af769-7d7463947damr3864414a34.6.1773088426862; Mon, 09 Mar 2026 13:33:46 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d74885b5a4sm3036494a34.23.2026.03.09.13.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 13:33:46 -0700 (PDT) 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 RFC v3 06/10] usb: misc: qcom_eud: fix virtual attach/detach event handling Date: Mon, 9 Mar 2026 13:33:33 -0700 Message-Id: <20260309203337.803986-7-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260309203337.803986-1-elson.serrao@oss.qualcomm.com> References: <20260309203337.803986-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: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA5MDE4MiBTYWx0ZWRfXwmshwPAUhxw4 CI3gOUtLdpc8GnEgriERoYu5ybXnVYrcTdA6maoPxukbj0iKwUufIijV6+J2/9HhilNrpHrJact lHTfzEZPL7aedp77GI2nwV+XO8om0hToQMiZ8MvoSy+j5ctnWVXXgh6yBFh7M93StsnoKFcXTwy Z+p0YNxb+xuGnMdieiIbPttXxoQSSi1+GWxc8nnsxC7dFJsDU0HpHkycPSuLlKVAv7sSgMG5zbS Z1W67dElgm9SoO5SPB1HgA8C+rl9QYNpNRNlNkri7Koml99uJQgCdO3D4mVAhzE3cinFp7+SteN W3sEIMN0Udp1XJmWuemW0pUi+OFc6UFj3eFzvFUqqkuXeczQ9muU37GVmimsaLiaXs9MdmGXD9q bQ14rbG2HW5QyE3qVg4mBsvH1OTrI8LQc8ZxantWzZ1YRoiTzppflCa6TY5nlCl8V0UYUpAXvdj 7omkgGDORu8001DsvAA== X-Proofpoint-ORIG-GUID: Wfo0ZUuJFj120BpMcSqSxtheRPiCVPwo X-Proofpoint-GUID: Wfo0ZUuJFj120BpMcSqSxtheRPiCVPwo X-Authority-Analysis: v=2.4 cv=WtEm8Nfv c=1 sm=1 tr=0 ts=69af2eac cx=c_pps a=+3WqYijBVYhDct2f5Fivkw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=oDIJ3hVRoRHbvujwG_AA:9 a=eYe2g0i6gJ5uXG_o6N4q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-09_05,2026-03-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 spamscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603090182 Content-Type: text/plain; charset="utf-8" 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 4fd08962d4fb..3a71a0d27b5e 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -280,10 +280,26 @@ static irqreturn_t handle_eud_irq_thread(int irq, voi= d *data) struct eud_chip *chip =3D data; int ret; =20 + /* + * 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 =3D usb_role_switch_set_role(chip->role_sw[chip->port_idx], USB_ROLE= _DEVICE); else - ret =3D usb_role_switch_set_role(chip->role_sw[chip->port_idx], USB_ROLE= _HOST); + ret =3D usb_role_switch_set_role(chip->role_sw[chip->port_idx], USB_ROLE= _NONE); if (ret) dev_err(chip->dev, "failed to set role switch\n"); =20 --=20 2.34.1