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 2D3E124A058 for ; Thu, 2 Apr 2026 02:26:03 +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=1775096765; cv=none; b=QbaDTDE3duhATFlnVHFjvmEIyt08QHJtVYxIjLuqyL9gmlymHuSiK22sIz5mJosGQ484DAnnr6LapTXTcppDC5Z6ISTp4nwpeAv1O+cfBrh72kcYH8QItwJVKz32C6zHfbz4lPxeZkzwJ2BSwHyJyApEhw49WwqNOqMH6pt0ibY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775096765; c=relaxed/simple; bh=+hdin/cabmUnkeHYjAQY+h3l/3itYJtI+V7QeMIgFB4=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=EnL6Qy3h+OHaDEQ0vSvwf1VAtI8S6pqsAUkolk0fBzubTxUYG/2GyRkiDBO6udqjoFZzGAzmOtJkzNqLUuZZAdbdOKmvz1kLNuL/W0ynavOMyt6dY7bTz4y5SgD2YcBqvI+Oe1s5Do4j0ZMYGcELvI15lL2wtgSJTvk7tmQEbdw= 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=lKvz3NRj; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=SkgBFstD; 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="lKvz3NRj"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="SkgBFstD" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 631M40TJ1128559 for ; Thu, 2 Apr 2026 02:26:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= YoETeGfnx+ul1+cJim1t3718pgueffgoi0/3qr5B0f0=; b=lKvz3NRjg/wwN+ja SnR04LOM5HUkSFyYAkyyiQhkVdNaU+j0X+wDeH/p4AzZhlkTi3tfBJ3X8IfRNuN6 MarWuJjXT5sBidS367kxwxNe7hP0i6JKJr9HSKEG0SHBvf0ZprmKfGgQJVGGkDqG NCGJ3ly6HopmWx6s/ymMOHrXyFC/7HgSVJKp+BS4rv4ldHeDxWbS4lTeoC3KpM+P uIZ+ldj4kcv5pgxCvccXqms8IYnP4mLPXHqlUT6y7+3f5A3Y7slufIIF/P72mEyK 3+g27DPqRP49FJ73PEcnfBjIyC9D+bWVY2p9DGZWVfsZcba5ICjlgnYqoy1kV/mn hKnmhg== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d96k99tpu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 02 Apr 2026 02:26:01 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2b249975139so9901475ad.0 for ; Wed, 01 Apr 2026 19:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775096761; x=1775701561; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=YoETeGfnx+ul1+cJim1t3718pgueffgoi0/3qr5B0f0=; b=SkgBFstDEmAh/g/EMWfgYK3NHeYbTImbigC55ongYiNwVA/a3ubjRf6prYIAYqhRWm ku1K0UF+64uuDs+xqW8O6GPjJ/2yvb8YzqVSyOfA8NQCXeF6QNsoDGYOVlFlLqmbYAWn EQlYkRZMGUzYLoP7QL78EEaai19ZnJcaZDpXjd37NDvg4HPZbpbEl1H4qaDafq02BEFQ ZeBWBqk6Gqxs+qkSHi+xkQmmHbeA5KmHcF52DzdalH38SMr0KI614lZ+2TEUryEh0NR7 7PCKhP1iC0Ot2IXWvWKAu+QL0D+O2usPVZGLrgODxc+jhA/p/isXsu1o8AXNo5uexGIb KdBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775096761; x=1775701561; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YoETeGfnx+ul1+cJim1t3718pgueffgoi0/3qr5B0f0=; b=pU8idw82KDYar0hzd1UCZ10XZMSl070DwtQpbCv72iT+d6LjW9MbTzQuXYUpRYU/zC jGPtLMBYm9v4fIIg3yPbvOzv/ku3LIw6flarObwGZG4xEv0wkQYu8s/J0RU0kyxSs4Sw q4P13QiP5Iq4nJ9GWgc1sbDBIamUvbeHMnaT5JWugcylkozAXo2mTqNQMZC0Mw0/CWGp Oko18j45rxVX0Lc+0rOIqiY4CEniFJlDxR2J4eLaGB7rBuQOIGQF7EOOtG3R1HxhHrwn r3m36jGF2W7L32QUZsJa7vBbzS1o6BNXUp+wfuwKK3AVBANgL3J/fwLdsiTY3omJnTtK TkRA== X-Forwarded-Encrypted: i=1; AJvYcCUWh0yVr9snKclddnEB2hFC9cfTAFBWolqfBLJHoWXvG9NZpDbPNG89Ryux+KJExeqO69a7TccPRrNtkzQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyHR+0NTNAmQAm/wm4+rufCCxe6TIJPVIKuDa5BI0TRpMlZ5cO1 TzNn4GEOw1h1+flFbLjhzRfIb4OgvlR0nOX3JEnxhvKSXuvNK5vJr+Nj5iIwdpV8DoKH001o2SX 5+/YKysFL0mzK4L+dlSwTVvcSEnVWCPt9VPI6KySbyhpJ1jtAFjm3KtAz2KrxR70ivXo= X-Gm-Gg: ATEYQzxfsNepuo/nn9c3YwQ4JjyFureGQdN7QHC8zgAK0/K/v68Yn34iGt5NC5SyKGk 4+jMsi1CVRvJbMPWF1cRY5ALIygzZvBGWwZAXertHXekOLqsq37OwN8pQuDqNAZfFUDIFJ1KJY/ AcNQ3WCOnfSG7QU5rxapnK7hc9uYbFzvONXKNTj98w9Rferj5Ji0g23lyPmQb0QnkD13ccAE/Bo CcTB3oJr8WS+DiCYFfV/+jZ+ZLfhczc8A4eSYsIDZlOj7sXdsDI7xUSpg17VgdkQhZL8Wai4G/0 cYFcQt3b5kc1UXeFoTRFJRx6w3nkyBzCHxQw5nj6kZowBM6fPEJkgO95aAoRoPVAtd1ehnJ71mb Ovu6UTlTkAJjk0E2DppP4xZ82+MeWClCinG0I4Drtbw2+ngF5 X-Received: by 2002:a17:903:458d:b0:2b0:5923:5194 with SMTP id d9443c01a7336-2b269d000a0mr51326635ad.27.1775096760986; Wed, 01 Apr 2026 19:26:00 -0700 (PDT) X-Received: by 2002:a17:903:458d:b0:2b0:5923:5194 with SMTP id d9443c01a7336-2b269d000a0mr51326315ad.27.1775096760454; Wed, 01 Apr 2026 19:26:00 -0700 (PDT) Received: from [10.239.97.158] ([114.94.8.21]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b2749cbd85sm10116345ad.74.2026.04.01.19.25.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Apr 2026 19:25:59 -0700 (PDT) Message-ID: Date: Thu, 2 Apr 2026 10:25:53 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches From: Shuai Zhang To: Dmitry Baryshkov Cc: Marcel Holtmann , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, cheng.jiang@oss.qualcomm.com, quic_chezhou@quicinc.com, wei.deng@oss.qualcomm.com, jinwang.li@oss.qualcomm.com, mengshi.wu@oss.qualcomm.com References: <20260108074353.1027877-1-shuai.zhang@oss.qualcomm.com> <4f0c351a-4268-4cbd-92dc-a5cc9845fb85@oss.qualcomm.com> Content-Language: en-US In-Reply-To: <4f0c351a-4268-4cbd-92dc-a5cc9845fb85@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=doLWylg4 c=1 sm=1 tr=0 ts=69cdd3b9 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=F5nhctsNCyJB_H0xsZgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-ORIG-GUID: KXaiW1bFmjQMGy8Lbwdw0k_-PPZkvQNG X-Proofpoint-GUID: KXaiW1bFmjQMGy8Lbwdw0k_-PPZkvQNG X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDAyMDAyMSBTYWx0ZWRfX37Tp/MTOkamC EU8aWVNW5yZBDhnPkXlNwrEXEZY33fAPqKj5vJuzxdyzc/aM+oB/JwKRFC0YsrBwdacFNQjbv8z E2KemEKCcLw9ZR/uGh3kw2+qGZleKBmGViDBAs8FF5WTuDnP3JwKyazBQH7J9bR2OuaRwWboP2P lhhmm+tDOq1ePioWjPsJMsuuyiCD+mqDv951foKNbUml+lgAXS9BlDbN0N2qJ1Ta+uS1kA8MpN5 IWttS2Pua1euoQgDrQGYgQCOR45c7I2uCyH8yhHDe2OlH0FhKPVlaqmI9XkxKuA+DEg4vgGDXPc wLpCaZcub57pDpuc9qhWG+UFzN574liolEOTII/3GYX7UhyBvNDFqVQzbx++gtrpMxk8dp+9Xlz qc980wVjaCsIRmQHljjtql5fm/Zgj1XPOerr+IVafnUTbCWThVwgnsGYmkvPjWjareXVyYQ7TqH wLA15Do0wACqAcp+/kw== 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-04-01_05,2026-04-01_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 impostorscore=0 spamscore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2604020021 Hi  Dmitry just checking if there are any updates on this patch. Please let me know if any further information is needed. On 3/18/2026 10:32 AM, Shuai Zhang wrote: > Hi Dmitry > > Thanks for the review. > > On 3/14/2026 12:06 AM, Dmitry Baryshkov wrote: >> On Thu, Jan 08, 2026 at 03:43:53PM +0800, Shuai Zhang wrote: >>> Since USB can disconnect at any time, if it disconnects during >>> the BT firmware download, the BT controller firmware version may still >>> be updated even without completing the download. >> Does it not have any check for not completing firmware update if the >> download was not successful / complete? > > Because of RAM limitations, the controller updates the firmware > version during > > the download process,even if the download does not complete. > > Since btusb cannot power-cycle the controller, the only recovery after > > an interrupted download is to retry the firmware download. > >> >>> When USB reconnects, the BT host detects the same version as in the >>> firmware file, which prevents the firmware from being downloaded again. >>> >>> Therefore, remove the equality check to ensure that after >>> USB reconnection, the BT host can still download the firmware. >>> >>> Signed-off-by: Shuai Zhang >>> --- >>>   drivers/bluetooth/btusb.c | 5 ++++- >>>   1 file changed, 4 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c >>> index 646de80c7..991064a25 100644 >>> --- a/drivers/bluetooth/btusb.c >>> +++ b/drivers/bluetooth/btusb.c >>> @@ -3503,7 +3503,10 @@ static int >>> btusb_setup_qca_load_rampatch(struct hci_dev *hdev, >>>               "firmware rome 0x%x build 0x%x", >>>               rver_rom, rver_patch, ver_rom, ver_patch); >>>   -    if (rver_rom != ver_rom || rver_patch <= ver_patch) { >>> +    /* Allow rampatch if version is greater than or equal to >>> firmware version. >>> +     * Equal versions are acceptable for re-flashing or recovery >>> scenarios. >>> +     */ >>> +    if (rver_rom != ver_rom || rver_patch < ver_patch) { >>>           bt_dev_err(hdev, "rampatch file version did not match with >>> firmware"); >>>           err = -EINVAL; >>>           goto done; >>> -- >>> 2.34.1 >>> > Thanks, > Shuai > > >