From nobody Mon Feb 9 10:12:38 2026 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 9A1C230FF08 for ; Mon, 26 Jan 2026 23:38:40 +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=1769470722; cv=none; b=fBHC3GZ9kGCDEokP7IfEA/GnsMitIeQwBRdpd2tRDUQhhm5BzwYi+tQm8aTxBLsF/BuAWwX5q5Ztg9Coz5sVZrePRYmAKTVnKTN+J8Hj1ta+GipXhHDMN/UgnM1VoR+QqFhllAjyltfP9evNspI6s2TBtodc0yfV4p7hDhyrDtc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769470722; c=relaxed/simple; bh=jYMZSplTH/Weoy7w2xwkPNIev4l2TEwX13EaENGM7y4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=R196s9LnsvKu8nek5Eclt6X+1dnBkAqKmZ0wbZNxTLuXyAxf0xNNRVPBYPjMusAMJwu57dE87fFuAvM8gV1gBaW7NeeEAYGCvwMd+sGJVo3E2g/qThG5aZdH+X+5ulfDi8llbJ0+/GIr9oq1CMaUe7+b+EN16fhTOhHJI9+42vw= 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=HVK+8wbC; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=a7pNHP1c; 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="HVK+8wbC"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="a7pNHP1c" 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 60QLW2H44101085 for ; Mon, 26 Jan 2026 23:38:39 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=HVK+8wbCdiIs/l622lAVwrz3EeR zZqWYZnv680gp+5x8ks1d/+hNAudyePUvl4hwQ8UyEzi0RvMYdRjhm5WZEQanFoo wcxEAsy4QcIzrchJtfC1lDWC41ORL3SlmGL2lrzC3VeatKga/NsYwBW49f563lE1 9B/1slmi+4lMdXWtn3M+B2ND21lAfVtEK7xSZWMvucz4VCJ81u4gpern3vaJZTpk mC6RWH+rJJSemB6MmklBh1vVEVhryPZ2sbmXu602vXftKfaQbxDURRGlhlhfyJNk 6g0cb4qm14ZuB/M0ZSqhIMstaCjoPcL4Nb/+44NFXZ/XuJWmCQZFpa9KEIw== Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bxg93g922-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 26 Jan 2026 23:38:39 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-1247bb4db53so6100958c88.1 for ; Mon, 26 Jan 2026 15:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769470719; x=1770075519; 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=a7pNHP1cvb1wWDN0IvEjz9A69eZz87TiS59Irf9RLbwZBf1+qrymnjqbOKdsO+2053 cbDVTLLdGGdBmcXC39HF76dJEYHt/499iLg24VE7tNJf+Ea3zUZf9todHXYlJVKUhTij pMGxPlOYRlr/j0ppuUyT/UNbSKL5Jt/8mdrgTF+rifJoiYurjBA1Ywafpdz0p08xN9lS QWDJAehi79jx63frFv2+z0u9VyqNhku3TEEqEN2QtsRA0NGusLwXiGKU6OjWbPnWXLpV S2YAVvt+EvtRnZbYpfT/vcWIPUgHPblJvCMfZPy64KR7Bc28Xv5/F+Hc7+NyMGi+kbYR 0QpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769470719; x=1770075519; 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=ItX9cOZSy31TBuXR76GqoERKKN0WUV+ZuG18rrfw20easIqu7i/BZo+6GqVaCBwD3c UFFRS2hZSsJ/nkL4WnP1TrR4qP1QseBdd6uzbtrLHoibT1kXa5PghVJkp1W10WGTXdYw HFtHgTKv1KjDMxxVVw7jrDq0fm2qNzImR7OwtfqYxmYlqKKj1AfQktaiq9faTgEyE3W5 J3VLhn2PlcvVM+DIduVKF+yNJLkfOq7fPAM8Lzv/2UCt5j9Geu8wfiP+lyx4A7+JhMZU nbpH5ER6YyprOB/n8+CGR/RHWFda/qJyejahgZKOZyQZbhUArJwngfRu8WarbZrh9+Gm twVg== X-Forwarded-Encrypted: i=1; AJvYcCXzJv6a0usEpzi8BcSOJFGenyCrfNcxMRuOvQ3rufcXDbPSX3FmeRl/Z1BV/IW4hPKdrRdQny46CGmMBcE=@vger.kernel.org X-Gm-Message-State: AOJu0YyGYuCGI+Y13H5dUyoNyU4JLNpY//Ate0A0+K1e2nJ9AmIDVLGf xBzd33ggZfJjFZFA2nQ6HAXGJX11QmGSwK2yluTnlvM9+YdbvO5NvfWKOONLHFykklbr6DP88kR d+1rp3CCzsMWhTsz/+QEMdQG0SwJ07ZBbCp6oUhPgLDSJk/Gf4APKxAEIhsob/3D3wd0= X-Gm-Gg: AZuq6aLIFDxBT/VNsF6d8aa2u2L4HDyFPWuQZvo3pXMAilTd8NcnLgdhNtGBj4mou8j 4xqBLfkHiiy/RE6vV7GBew9n5HyEY6yDWjr6o7mP1lzYolOGlq2mY9VFDN4y9n2NgpH3FHSGAcB G8HeWWMhK6jLRjhZsSx0+HDUpW13Ks953sn8LPnfum8UxGZsBkh30LAgvzM78ZLY//TMxSvI3s2 0qFikILAOD8o3UinGWExHYAxyrd3GwHs/qEdt1hYP24y9omWuH3OUs0SKNwx+MnNspt2Wv5/Crf zhtcJ+9vtNtyMKk3Bzb450ku3NxpG18QPeptqMKLNvhE+SAv14iMKSc1CQmbIBf4sAIFd5PC01k +4TQv9aC8IB+644TLMCh91ovPFReMdvzQfQyFAe64NdNutVgZvttGfc4YhDsBR6U= X-Received: by 2002:a05:7022:d95:b0:11b:1966:8732 with SMTP id a92af1059eb24-1248ec698e2mr2582775c88.25.1769470718452; Mon, 26 Jan 2026 15:38:38 -0800 (PST) X-Received: by 2002:a05:7022:d95:b0:11b:1966:8732 with SMTP id a92af1059eb24-1248ec698e2mr2582759c88.25.1769470717874; Mon, 26 Jan 2026 15:38:37 -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-1247d90ce0dsm19948967c88.4.2026.01.26.15.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 15:38:37 -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 v2 7/9] usb: misc: qcom_eud: fix virtual attach/detach event handling Date: Mon, 26 Jan 2026 15:38:28 -0800 Message-Id: <20260126233830.2193816-8-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260126233830.2193816-1-elson.serrao@oss.qualcomm.com> References: <20260126233830.2193816-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: AW1haW4tMjYwMTI2MDIwMiBTYWx0ZWRfXy4+YSqjVxF3i bjvEhE7HAH/+Y6PCM63xkyspwPJCLj5VnIMJX7OLreZgIy+DJeYfltov9vJDGlgfFUOKb4eSL4E YcMM9ZVFh+/ROMOTZxJ2Z8j5P9pD56oeZUaqceUasnsXiQqag07XnxTWRfOaaLC3kiCHeg3mLOz GyluD41Xk1lWYrc/oZDRBB5IVgZ29ZcEiVoQJfOHUzO2C6/GmDaf+ywHplQe3i/yfEgwrVqUAgx cXuzmZer9DhvLJEJKOwplO+0VxQnuhXKlp2r7mLrcSTrc89kWDtS7DYDlk1PSzBwHyXNW9XuCq5 9Ov9IodSTl7UjaMDXu8r/6S4r73j0ZdUdRhTuTkOGQmoSuatQnfmv+tnZiL3tgeHXmffrMJOc+P e+FsII+VxB9+a3IJoivEYTS6sGkJ0EPPt6/Pnfi072LaTOMI8GE1xX7f6O+kg63zy1n08KArspt 0XVzoPl3rmxbs/0uVHQ== X-Authority-Analysis: v=2.4 cv=Uc1ciaSN c=1 sm=1 tr=0 ts=6977faff cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=oDIJ3hVRoRHbvujwG_AA:9 a=Kq8ClHjjuc5pcCNDwlU0:22 X-Proofpoint-ORIG-GUID: 9cHmkIg7MVgit8IuH2fYg-ot9UWUGQvJ X-Proofpoint-GUID: 9cHmkIg7MVgit8IuH2fYg-ot9UWUGQvJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-26_04,2026-01-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601260202 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 Reviewed-by: Konrad Dybcio --- 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, voi= d *data) if (!path || !path->controller_sw) goto clear_irq; =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(path->controller_sw, USB_ROLE_DEVICE); else - ret =3D usb_role_switch_set_role(path->controller_sw, USB_ROLE_HOST); + ret =3D usb_role_switch_set_role(path->controller_sw, USB_ROLE_NONE); if (ret) dev_err(chip->dev, "failed to set role switch\n"); =20 --=20 2.34.1