From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795682282; b=XD4ajKwQ/rpM/klkHrYXtg7GRpxxKAm7S9mhMUVXFtJCfsSD5b1NIhxL4JDDbe0mG+fe kO6PaQH42c19BSk5OQz4PTW5Q5HulR7RPV2PWtS71LgNNnrxgFshQGghBkPt//Teh/IIq W2LrQloFa1qNoKQdNwUpQkRVwcgXEV/FN6brrn2XCk31Dz8EOdqrTfh7mRiuQesedMM0z vomxuRK90HugAHPfe4EJhpavR+gsoWz0XyD2eeA0yunBUiknfHcMliEybFLogjtqgFrtG HY6GHwiaqFnWvjUxaSWBd9M57VtMDGWYvkBm2CllinbBfFgsqJQQeuW0Wp0bhY+mCWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795682282; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info: X-Authority-Analysis:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=WQPx9qKiYiOC+Qu5wRqDaiDPoYwCF37v4r4ojrWgYNg=; b=KPdGtFjX6i6oGzO64uSUXzzp/H4InOTnGPbMXlTwhvBQjlzBSRM3BYoytBrQ5B8wa5L0 1utz4GTVVVZdzL63/pXZx8lv7/vjHYzFG1i8+/a+8t0JuHxEG6+lO2onhIiM9Ua5/B1mk lMU0hUhDFC0aXXI2XcwaGH9JzwHyhSwRGs0owJY5iGkmfdqurnTkPqp2/M6jdrSuEBDjp d9HPCVkB4CJZ/MzhEg8SI3gnnxIL/yvx/1cz42o2u05YyqY67gWpUHefRor8mx0UPAg91 32cbUmN9j4/icZSIN9h68jPdiJK0p+RTz/Bhn1JJWPMxjo9LCmOzXcGPpCsezwGfp+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b="fK/KNW3J"; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=TOq5g7uc; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6611606A32A for ; Thu, 26 Nov 2026 08:38:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B6611606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=fK/KNW3J; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=TOq5g7uc Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AQ7B2hs1682388 for ; Thu, 26 Nov 2026 08:38:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=WQPx9qKiYiOC+Qu5wRqDaiDP oYwCF37v4r4ojrWgYNg=; b=fK/KNW3JrLr3ekiZDOsKo3oXpjL6zpTkYQlblXef xJ/JmLp4vUmHcpOqd8zl52ccM/FCqDidbdI5/oPNjfSE+6k9idpYFby+sMvGm5j+ 1aDqoksZvM0QxOeC78NTMVnGoLkML6qrqiOfJxVmmQMl4Xi8TlLT6p5waAQFBei5 2wK/2cnDYrjZwJKb+38gy2vWI6uL28hROIDoSx4SK761qa/e1bq1IVypUo1zq/CZ 3NFH0VswAQfCvOq5nyXdn3/r29GPKGdyf2jnnaM2aIg4fpmLJmyMslL+2HeHIPrB qIMoI3mMLrHya1BvJhdwf0NX3C6wXzIyEAzsxgKZnyci7Q== Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j62aek801-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 26 Nov 2026 08:38:00 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-382af5cfc58so2802320eec.0 for ; Thu, 26 Nov 2026 00:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1795682280; x=1796287080; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=WQPx9qKiYiOC+Qu5wRqDaiDPoYwCF37v4r4ojrWgYNg=; b=TOq5g7ucgxhjxObt30jm2lqKyLr0CppaxoGxkuOwP7djCcnh6vTbrP/kk5hQNGjbC3 xQmQERjAt3eBptW7yBbsNXk3bfjP2G2MAwTINYTcSSC6ceoCAHbX5rayf/nu2g0pmvyU mD8aAA6eUmnjEbjfZ16NVDp6mhmUfrFUM+Dgewh0ml2IXLB/6MQw98zSBDuKGB+UBfEe ODDO8ASfC5/2J1uurHjfGQENyvPrk0KJ+mQKYpbX6QmbsmgC+cIUWZicOadBov14rTFM ibX69BGZJU+Jt6EDopHjNjEKkDtdDMIOwl5cT0VCxftGLwP7NpwBkeZVz1w+fnrgRV+P hDRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795682280; x=1796287080; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=WQPx9qKiYiOC+Qu5wRqDaiDPoYwCF37v4r4ojrWgYNg=; b=qts+/7VnbNQ+p2r/G3rm8fHEEUdOx+aZZrHfdDujJ6QAlLmUdnHhfqt7+ob9riqHpN 66TfX2d5vQfldADZsCrusjMxSGIayGCeH+gzjLPKrN8XJSeHeK73285rg5fwxh6lSZoN u4LL/9HDjZcA5/qcvekk5LAd/UzEyPBK4/7YzYAk0Ql4DkwotjfsLJ1g+HKH8FZnMW1x dclcTbNMbyzHsfksm26Gqkd7u5oWolbfLQawXPZjCfowVrqdGls7jQ8Qbfi+5vRcYNs2 ZNDgl+zMTUeZ+7rZ1/qF7y8sy2lVojkS8hUzo10RiKt/DMuVPv53YZ2V7V790Y9duJ/u veNA== X-Forwarded-Encrypted: i=1; AL+hErG49edZCuMciIuLj/KlAXZO0OroKyudi9LMXfQI1zDwLtl5CckvYHKOTTfsIZQFCJFBA9dfWg9SctuP3FQ=@vger.kernel.org X-Gm-Message-State: APuU4Z8jIjcG2jvt5nE2RI/u5cURM0QHGVELXTRQIiLfA/2uoF56zeYh 9OnWNkv/Obg/wgB4lYe7nvT3gcVoGlAbUtgz8yhIJlIqyTAKiHv/lHLqzOFjQJVszsOAzOlSv7g tbaI2fPiKtq47coUGpQt7YqHRjsbJXwCBZykA2IcCpPFyq/EUIUr0JihLrQN6YJAMMAs= X-Gm-Gg: AZFdTZc3fPW9h2aDMWI3sTiNJA0ULg7abOBHaFFhzmSZe4UfSvGC7nyZVhSNn67HPZW eowwqshJdm3q2X2Lu40eG2sj1RJXgTHxsee0ruFzbqN/2toM+gMJKxnSJxtXFDYwecDv76+fC2w xt/ej80YOtZqBJBmky+ANL2m+MBhWpcCYKeV6s8u8LZMFmbdwJDGtq+PYyrAKZQ0vCp8CGYYRPi nJoittzeIFITglFgscFPQ2qfJt0HzPnh1XkjkqN59BsErZMW6d0VdYCo8z/3hjsTnX8I1W+3Vw7 OGib1HTO3p1jN0Z4dBEW9lU323uhrExFQCtAkBqmqXSZ47DOwh/TQkkbn31fsV0kHjLHRaqd+Qi G42xR5NApEYyjNM9k1/Q9Akw+OgZpBTg4h9MQGZKGyh68xZoXZpqAlDiA/PbYpMrifcR0hDhblD Vaq+zW9gppo/sk1GpNkmjFTw== X-Received: by 2002:a05:693c:61cc:b0:386:98bf:c6c1 with SMTP id 5a478bee46e88-38698bfddfemr18800994eec.26.1795682280027; Thu, 26 Nov 2026 00:38:00 -0800 (PST) X-Received: by 2002:a05:693c:61cc:b0:386:98bf:c6c1 with SMTP id 5a478bee46e88-38698bfddfemr18800971eec.26.1795682279493; Thu, 26 Nov 2026 00:37:59 -0800 (PST) Received: from hu-petche-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386b9bdafb5sm27849473eec.9.2026.11.26.00.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2026 00:37:59 -0800 (PST) Date: Thu, 26 Nov 2026 00:37:57 -0800 From: Peter Chen To: Faisal Hassan Cc: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, krishna.kurapati@oss.qualcomm.com, krzysztof.kozlowski@oss.qualcomm.com Subject: Re: [PATCH v5 03/11] usb: dwc3: qcom: Keep wakeup IRQ enable/disable balanced on failed resume Message-ID: References: <20261123104727.1539149-1-faisal.hassan@oss.qualcomm.com> <20261123104727.1539149-4-faisal.hassan@oss.qualcomm.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261123104727.1539149-4-faisal.hassan@oss.qualcomm.com> X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTI2MDAzMyBTYWx0ZWRfXz0Rz45FKujCd Afu+pMZYoZOLt2pIbNgPKr7z7eF4h5UzXWDZKtGtEtJdkq0tCT2igmD/g97ibEbk1j203S2ioM3 MrsqWkW2eLOYHxIYkrEP2jQcIjyzPHix12k3EkFHlTHna5FBwsRvBVvoEQD7ZOsLbyqncivyul7 EzOMC/EKapoeafC8FpKXH0tB4qT/0o0f07RC1bZ7fIcmztFexLk+L49eiEozht5yuanNZJH/bcH Nx1HHicZJAQOZmzXv7+IKmBTKlbDfpwei6WIy42yahjwdqbQZIPfc7cKPopwTx00zkXBFshcLPO XUHBawoKQ2CUyCPS9BZqZHKC7vividSLCrI+OzmuucBpdhntGiUIdZVZtU1R65JdgxjduKqkmr8 RzKeoTzul1HuaQbkPQt/JjBFhHKBR0aquqpdOxp/ZxSL4wDg2+GMOGFMJLtpUdxpQqST7hvdoFr twxPzfwVboh9XKF62NA== X-Proofpoint-GUID: i3_0OUA1QbxbRKQRQZ56awXyPXWLh-_j X-Proofpoint-ORIG-GUID: i3_0OUA1QbxbRKQRQZ56awXyPXWLh-_j X-Proofpoint-Spam-Info: AW1haW4tMjYxMTI2MDAzMyBTYWx0ZWRfX8SBalPpbo3rO GXLE3da6woQPOtwmIlBA0htUW1M5Yi+oRVUv6xelUGWJofjRdpRvOUadsiV6yKkPeGiDdXQE4Mm 7iTNLb+Xup/cEI2j/LQQo1UUs5fkxjk= X-Authority-Analysis: v=2.4 cv=PqoG/AM3 c=1 sm=1 tr=0 ts=6b07efe8 cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=kj9zAlcOel0A:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=kPxKJPT4JOKwAKEPVQYA:9 a=CjuIK1q_8ugA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-26_02,2026-11-25_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611260033 On 26-11-23 16:17:18, Faisal Hassan wrote: > dwc3_qcom_resume() disables the wakeup interrupts before enabling the > clocks. If clk_bulk_prepare_enable() fails, it returns with them > disabled. The next suspend returns early Have you run out this sequence at hardware? I find the dwc3 core suspend (dwc3_pm_suspend) has not guarded for is_suspended, it should run into some problems, eg visiting register with clocks off, etc. It is predate issue, not related to your patch. > on is_suspended without > re-enabling them, and the next resume disables them again, so every > failed resume leaves the disable depth one level deeper and host-mode > wakeup is lost for good. > > Re-enabling them on the error path is not safe either: the > level-triggered ss_phy interrupt can stay asserted, and the handler > can't make progress while the controller is not resumed, so it would > fire continuously. > > Track whether the wakeup interrupts are armed and make enabling and > disabling them idempotent. A failed resume now leaves them disarmed and > balanced, and the next suspend arms them again. > > Signed-off-by: Faisal Hassan Reviewed-by: Peter Chen Peter > --- > drivers/usb/dwc3/dwc3-qcom.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 18db19cf2065..e7fadad9a4e1 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -81,6 +81,7 @@ struct dwc3_qcom { > enum usb_dr_mode mode; > bool is_suspended; > bool pm_suspended; > + bool wakeup_irqs_armed; > struct icc_path *icc_path_ddr; > struct icc_path *icc_path_apps; > > @@ -323,16 +324,26 @@ static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom) > { > int i; > > + if (!qcom->wakeup_irqs_armed) > + return; > + > for (i = 0; i < qcom->num_ports; i++) > dwc3_qcom_disable_port_interrupts(&qcom->ports[i]); > + > + qcom->wakeup_irqs_armed = false; > } > > static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom) > { > int i; > > + if (qcom->wakeup_irqs_armed) > + return; > + > for (i = 0; i < qcom->num_ports; i++) > dwc3_qcom_enable_port_interrupts(&qcom->ports[i]); > + > + qcom->wakeup_irqs_armed = true; > } > > /* > @@ -396,6 +407,11 @@ static int dwc3_qcom_resume(struct dwc3_qcom *qcom, pm_message_t msg) > if (!qcom->is_suspended) > return 0; > > + /* > + * If a later step fails, the wakeup interrupts stay disarmed, as a > + * level-triggered wakeup line could otherwise keep firing while the > + * controller can't be resumed. > + */ > if (dwc3_qcom_is_host(qcom) && wakeup) > dwc3_qcom_disable_interrupts(qcom); > > -- > 2.34.1 > -- Thanks, Peter Chen