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 A40F24B04BD for ; Thu, 6 Aug 2026 23:40: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=1786059642; cv=none; b=V/6IQAZ9Oe+GOz7fDFdQ+MRxYvClaJdh9ebU+/wJ9OzuVrE38HlcmCD6cPRGs9r7REXOBbpO7nhHFob5JKd+497Xkb0f050iiKPI7Dt9q2gPTr/p4e8H8Zhzfx0AV+22HzR0EFUmzQoYCk21OVnxpdoORHQEQLDvPrEEWuUFs6Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786059642; c=relaxed/simple; bh=Wx94yW7ALtKSBLWbhJnSlUD6LR5UQpjenk/XOMsNpQo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=S/rFSbXGvxC9iSpdzSUQGkTf7DluhtLw6RDyk0JuS0JsB1sIPqgrsGi+OpV3v+0K/LHbuiLEWVkbTgjC9Rcil59L/XhqAapAokPsvqEsn2eJU6ZG4xMUdZYKoRC86mRkuVprci+yUxO/QLM08nkwe19CNQVSmoyBYdiIMyISYXg= 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=CqCf5HaR; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bcz/j8wL; 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="CqCf5HaR"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bcz/j8wL" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 676L8J6Z3133564 for ; Thu, 6 Aug 2026 23:40:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=yqVmiI6E8zzLlQqCZJ4qBJ AFciiRRe0GNn/ysSt/wVc=; b=CqCf5HaR3Dkzq2+WldyPMkZKnsUzcO/xOt5ndz 3zxYWu/t1/rNBYmcjnKNkSerIBEhtKxOSTI1ost9PF9umAMe3amC3+09aJJtuiJA RhnUD5RswMOSloqzAkCwXnxmIK/lMFVeLdeo7TDVXBh3u49ULFFzv1YgYRtDnfVY bGhznVDnFkZTuaMUtYIqU0ArTG+eeRr2NhSR2uWg58yetJPhQE3exx9YAUj2QSlJ 1LgSDpAv1UxsX1Xcsme7YG9Hu566CidMA6TMDgJwChSZdMCOjj1UXqK8MFHWnXSq ByVMO1JDxuHcbNWJz+MfT49oxZ3UwnMT/ziuj9NJDdMKmsAg== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fvy6fscsa-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 06 Aug 2026 23:40:39 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-848662cd2a1so3355523b3a.2 for ; Thu, 06 Aug 2026 16:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786059639; x=1786664439; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yqVmiI6E8zzLlQqCZJ4qBJAFciiRRe0GNn/ysSt/wVc=; b=bcz/j8wLHNaakxa8zQnR8JHA86a1+6t2SgTwi1v2BFucWxTTUQvrBLWuvTxIEsFB/O dQl40BZP1kNsYvnldtNfU72Ee6bDSYD63VlynweUYzIfH/szCmEPVNXMVcJPj/FoOBZ4 IbWrrG7eMVarlpf8Gkue7sd8Ow+xUofjmbm25jUuieAIeRZG2I44BzQyIB2qeyGS3DVs EHSGW8XNmgG9wGXt/TXbrSu3RoW0nFyYCu5A50WF4mqQpVrkB3Do718dNmHYvmsDNVoo jkxSCh2HbWiYOKIiNcO9iQC8jPIdxkih88F/hYtdy5VFLNUPf01Mt9JBPo2vQ0QP7pkE fPvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786059639; x=1786664439; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=yqVmiI6E8zzLlQqCZJ4qBJAFciiRRe0GNn/ysSt/wVc=; b=EwOfgRaQUUyaMPUMb9hhtcX3bjikjL/QoEg+BVY5cBFoS4WXmYF5I62fTmi3NFZ6jj ZvZWo1B0yHmyMvMwzRyhdPHeZc6PN2ggewXf00c+fpCdYNFopaGQj7Tw4FBQM6SlTf1S 46aII4Lgy27cCrufzTbnlw5jGLrbEIDX8FPdcaEbr0yMgskESDa6e5n0RfrMeedPfMMs YMXpLCme8luapO0ImWHjqvIsIXloIOm4ZS2YK1bUxXgxcBOGDlAwrCbhrtEZ6YBiWHiF jIsiVf9Jbpqm6xfZfAtkWlZX/HC1kGAJWUdHTHQPVdERRFCfLyrR9vQehr7tduG6nO+4 HRsw== X-Forwarded-Encrypted: i=1; AHgh+RpdMvRBRF5lmHrSYWe6j+CAuB55LBZvyfv9vQmyx3+xXmvaBvdChc7uI3137UuMTmw4ZtsZ+tS9iq59veo=@vger.kernel.org X-Gm-Message-State: AOJu0YxeEQAFM5d6E+AMNI0JxuZ+7FtqcUEWN1LmUirjYOF0GSGFip6N TxuvehW0lxHQr2NKR8cC3WGyMIA4ucFeMbvYbprtmxeySZNV2dvrKAf/2yxn3pxDErJMrvB3u4n 81d/NBfl+UgxJHitOTCZYRReJBrPgLhPK0qNA5STJxskCF1k38p/6hcNowqKEesBxqJM= X-Gm-Gg: AR+sD12zhWsNRh4OtebFlv6peok5zTw5ccqmwTPulD4zs602LlWXjcGceycXDOJa4Y0 bsuPiN5jV2VSy07+T/Du7+RtWVvvh9rOv/XF3pKLa+3MjhUBTHSEjobuEaFbN2FG+YcYhdCk6ZX f6VndD/xOl25vV2c/cDZR2Dwl95R9Nu/dgcmmHReGOQ/0M57pMSpgO1qQtauX+qfwFZ/WdnqRjE 4jKijpk556y3MeHE8QC698sUtiF9UuOn31wuLlGRf/D7xhY50gbVnPMDlZBCerYodm+8P90opUQ 0hTn+utTNPGmcSbVFAAgK51B7zKvMEaEL871sKuYX+14CorMq3qYhnChJJeoB1Yca4JuugalmsL SK9TgL2HVx9yLyBOOyW90GEhvFr4H8QXvvzIQ/DdaQ4j0+sNnvgxuxw== X-Received: by 2002:a05:6a20:728a:b0:3c3:76a8:c0f with SMTP id adf61e73a8af0-3cb85ded9b5mr19830840637.4.1786059638555; Thu, 06 Aug 2026 16:40:38 -0700 (PDT) X-Received: by 2002:a05:6a20:728a:b0:3c3:76a8:c0f with SMTP id adf61e73a8af0-3cb85ded9b5mr19830675637.4.1786059636662; Thu, 06 Aug 2026 16:40:36 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-315beb877b4sm154694eec.19.2026.08.06.16.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 16:40:36 -0700 (PDT) From: Elson Serrao To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/1] Add version check for setting ForceRM Date: Thu, 6 Aug 2026 16:40:34 -0700 Message-Id: <20260806234035.1078704-1-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODA2MDE4NSBTYWx0ZWRfX8t2F65e4mYHH SiV2Ef8Ouamt1+nI9pZF8Sa8Eb6Wm8QP32HMt8eXdmAQOT4x+ZdV/ummbJkdNaxzEtIOc1RwTNV SQt4lEBDsIChh+ve/Qt9xDsdXD0f9fvAiW7NWsaW+kzY47gpKn5z+h0rApWZwbfIHshxfg08G9R k/9SgbcVq879auu2cUJNR6r/Vb0dL8NDvmJeoXXpeOMYFNm7OxfvYd7e0OliZXCXLa1YZ3QV0C3 mlvM6h+oevFlyX6kezW0RPQy7AeUEmqW54ACRitOuipTVju/0aR0ghFKK2wM1cp1hwanJ67b6rT OA5wGbiXxV9zLUFhTiJIlrq6zHj+m9KplRC5jXSRVm9hnxoyUjjNIVAWtqTbrffjvJGAykRpZkm kax7Xmaq7giwYybfqTkSwgRiKMZwnipumx/XY2lQFN8FpsUMJ471ntdZQA7OSlD/qwxz/eMWn1d X+EYwadukkX09WaZs8g== X-Authority-Analysis: v=2.4 cv=DvhmPm/+ c=1 sm=1 tr=0 ts=6a751b77 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=TA8obj8FJ-QJncC9hTIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-ORIG-GUID: JYuSeBqmnLoKq31jDNP9vya1037NZy3A X-Proofpoint-GUID: JYuSeBqmnLoKq31jDNP9vya1037NZy3A X-Proofpoint-Spam-Info: AW1haW4tMjYwODA2MDE4NSBTYWx0ZWRfX4TNr7HUQZqfa DmhHCbK/fNOa6W1EwDP/tGogvOEQEfqgQqKM9n9zRk6A34zOzM/Xjjt7A022ACwrSGAfvauaEuS hwoOF1qeT9ztqftTendxgngZQfkUl3k= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-06_03,2026-08-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 clxscore=1015 spamscore=0 malwarescore=0 suspectscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608060185 Hi Thinh,   We are observing an issue on DWC_usb31 v2.00a and v2.10a controllers where a transfer aborted through the ep_dequeue() path continues to generate writes even after EndTransfer has completed. In our testing, the issue was reproduced on an OUT bulk endpoint.   The stale writes are not observed immediately following EndTransfer. Instead, they are triggered when a subsequent StartTransfer is issued on the same endpoint. Since the transfer buffer is freed as part of the EndTransfer command-completion cleanup, these delayed writes result in an SMMU fault when the controller accesses the already-unmapped buffer.   We found that issuing EndTransfer with ForceRM=0 eliminates the issue.   While investigating the issue, I reviewed the DWC_usb31 programming guides. Starting with version 2.00a, section 3.2.2.7 (End Transfer) specifies that EndTransfer should be issued with ForceRM cleared, whereas older revisions specified ForceRM=1.   This appears to align with our observations, where using ForceRM=0 prevents the stale writes observed after a transfer has been aborted through the dequeue path.   Based on this guidance, the patch clears ForceRM for DWC_usb31 controllers starting from version 2.00a, while retaining the existing behavior for older revisions where the programming guide specified ForceRM=1.   Since I only have access to the DWC_usb31 programming guides, I have currently restricted the change to DWC_usb31 IP revisions. Please let me know if this is not the right approach or if the change should also be extended to other DWC3 IPs, and I will update the patch accordingly.   Thanks, Elson Elson Serrao (1): usb: dwc3: gadget: add version check for setting ForceRM drivers/usb/dwc3/gadget.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.34.1