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 774B331E845 for ; Mon, 22 Jun 2026 14:52:26 +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=1782139948; cv=none; b=CTreQgikHs8lH7gvxLT1zZSa2nk3K413+Hqy/JYB6Itp13sHvlMsquNtH+PDDuNPb4H/qASj1qlyeQGIytzHHhTsDi3mEzBXRlzEFAL1U1GF3hBDjPB2DwIxI5RsX8tSrC+CRIcSU8jeKShGoDUkuEkc0WAZXTIH4ffDsbuH310= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782139948; c=relaxed/simple; bh=godFh3XClGWYOD/13MM75KUQ5HsrEM9evqoKLd6UxAU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fybdJ4EtZu/m1i9SsJuNGERabeIqMPxdwTrIl/ul5i0YTP/FhlqbCS6VbS0RM2opa4YPPKENR91am9x2qIBRhog/IfWFBchguADl41GFAcuFEdEdajT5APtride97G88oMg3AwPTtT8JTruWREtgShOrg0fcY+3VTu2ruP95Ycs= 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=PbQjFj19; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=g8zQWQol; 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="PbQjFj19"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="g8zQWQol" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65MDGA5A1283664 for ; Mon, 22 Jun 2026 14:52:25 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= +jMt3mRcxAV9ld7CzQ2hfD6sxJ/UqAqyCYYaMjeqBTs=; b=PbQjFj19YXK0JdzJ Srn1wW17QL7GBoHVQQdvzlmxo+UXlCKtrB2XNxQPWojJeHyF1uDa+++Rk/zYQi3S Bdz71b4zP8ZmfnrP+Mlga+GXnY4si/tkTD32HQbMFSUmyWAX+A3wJKMAA3r25AKm DciTnrUUTgOeGF2JmVNSg32JbnBrFxpxIn2Q5wIizv3XpQaR13ZQQITyaKpj9+iN QKnw8C7+fyf6a452aQ4nc8CUQS7zre3E03n8w6J78303xfv8oifvfh9bwMwQSLXm 1crGzCJTvKkbOaEGSMtnW1uZVQ2U9pm7eOfWsMox8v3bc4w7CTKjgE669EbgmUXK LdQRng== Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ey5n40cb7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 22 Jun 2026 14:52:25 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-30bfae076e3so140079eec.3 for ; Mon, 22 Jun 2026 07:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782139944; x=1782744744; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+jMt3mRcxAV9ld7CzQ2hfD6sxJ/UqAqyCYYaMjeqBTs=; b=g8zQWQolppbY5o5lmgQwSmc11gmQ6PCkC3MHDUP+QMC7KU22a1hm7HQya1u6U6UA/5 KSiHMOTrJ7WxS8T+WfIcqF1sgpjGy4+k2Ej2fLPMLOI4VCSly8eGIRP7rg4mg8Tsji7p gIx+ePQ6Be+ShcOMMoRp4VRJuz5kJ/khiQqjvAbhYbdKLBuBzzQmIwDPTZ62gkjti0+L yIyva0gU2fhIs9WUlIcWp7nusvmpqvNlkLLPqJ+WbNF31N+lm7NrkzurplXI1qSNhhuo +g51ovYARBbpCUUQGKO4k3Y0yHpHqIruB3fKCQBSiEeYNfs8eoFdmicuimfE3cpJHgZJ PV7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782139944; x=1782744744; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+jMt3mRcxAV9ld7CzQ2hfD6sxJ/UqAqyCYYaMjeqBTs=; b=dhybqRwukkHpARSqsMxvPGmHPKKGqrYh6Onal1T48sG1a4m9TC9EtnGPfaPbMcgx1C d6BPt8XHat9oo+WICLbGHbmLnOVjWjGKoSBpfat8Jlh7jsRyN0Bi1tW85HBh/yUaBdBD pR7K9O/503O303a9aDBy3zYJbLOAAD00OpQIA50bojNwrEBLIXkqwOZJI6BqYFk7j/Pb VmFRkFce2ifdoda0MwrvYa//mQy/Ia4UIHoiJm1GYSrfhJV/Oj6UXsm7AYHzlCfKZV7X FGH2Mp7GiSQemfqCuN4OiUuq+tFjP+kieQRZwQ6jcPrNIU1Yo5wYAyfhfelGwHqoxDt9 FPhA== X-Forwarded-Encrypted: i=1; AHgh+Rrr2RUFndcRdxK9+KYM+ExQcFVsC6D/tmg++EubjUz9XAlNGIWPGmUjcPeho5Dv6EQq2kJQL7j1YvGhZ8w=@vger.kernel.org X-Gm-Message-State: AOJu0YxScNnpuzS0yT8cu90NoWBQEZCDn9dahwjVdnPhTe6OBcZp50D0 3hTfC5ymx5JnLTkWaPlBiDNlgSJHdDZ4DaAcOZ6w9N/Tz1+XXrtae/dWG3Vl3xwX1G35zAhmVMx UnU1tGb3CpgRUI9a2w+4cZXSaqDAiK5X7kAaKtnD1kaCIEuccx3G9Vmk+z5OwloxYuD8= X-Gm-Gg: AfdE7clRBE9AeMRQwuwJMaxYBkIkrS1ape2/9a0Z3H26J5mayrGO7L89WHXt+/2UkAF BC3wF+6pS2pq8A8xnQK802JKaH4b4oHr2EHA1DiAFHCMl6JnMgkiYAezP/UWhqW4yk8I2d1xqgG gfNo2a2bRSR1K7Ihc3p0in2H/qPK8IANqvAUOLmI7sDjXszphngmFzjmgskZ9EbnQecK1AhsS8l PoqYEMVqiHXZuWHLYR2qSdxg43bof4Z7HZ1pDarq1Js6Kd12d+3FbTh1GdJ1fJF0vttriabEjti Xf0ypmx5NTDcON+LNmULZUdY5qN7AIbIUvLkGvOa2WDWksaWWtNmGLKHYZ9QYXlGcKTcIDTM3lf HerXbTmaNnJgr4cqkAI8H5CbsUxzOzgxUrzPnL5+J0PyCO8Sn9AcLMl3awg== X-Received: by 2002:a05:7300:72d1:b0:30c:2932:dd2f with SMTP id 5a478bee46e88-30c51e22ecbmr234384eec.0.1782139944283; Mon, 22 Jun 2026 07:52:24 -0700 (PDT) X-Received: by 2002:a05:7300:72d1:b0:30c:2932:dd2f with SMTP id 5a478bee46e88-30c51e22ecbmr234373eec.0.1782139943757; Mon, 22 Jun 2026 07:52:23 -0700 (PDT) Received: from hu-zijuhu-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30c1bddfe34sm12025561eec.20.2026.06.22.07.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2026 07:52:23 -0700 (PDT) From: Zijun Hu Date: Mon, 22 Jun 2026 07:52:22 -0700 Subject: [PATCH 09/13] Bluetooth: hci_sync: Add __hci_reset_sync() for device driver 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: 7bit Message-Id: <20260622-bt_bugfix-v1-9-11f936d84e72@oss.qualcomm.com> References: <20260622-bt_bugfix-v1-0-11f936d84e72@oss.qualcomm.com> In-Reply-To: <20260622-bt_bugfix-v1-0-11f936d84e72@oss.qualcomm.com> To: Marcel Holtmann , Luiz Augusto von Dentz , Rocky Liao , Bartosz Golaszewski , Ben Young Tae Kim , Balakrishna Godavarthi , Matthias Kaehlcke Cc: Zijun Hu , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Luiz Augusto von Dentz , linux-arm-msm@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.3 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjIyMDE0NyBTYWx0ZWRfX+id/Y7g5ZzCZ rTZrHMzMNwYygLjvyikfGg/8qrgy7tHFpeRS2eehlhtwmEom7h3dw2CbD/86sjO0/oS+0eCLOUP EvGIQg7vxlOF+S29+69Lw4M2Q2oNkcI= X-Authority-Analysis: v=2.4 cv=R8Uz39RX c=1 sm=1 tr=0 ts=6a394c29 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=kQ_UBjYZPz6FNnKCBYIA:9 a=QEXdDO2ut3YA:10 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-ORIG-GUID: D5fQY8z2euPhmljQvg0OcXpMHkn8h1UK X-Proofpoint-GUID: D5fQY8z2euPhmljQvg0OcXpMHkn8h1UK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIyMDE0NyBTYWx0ZWRfX1e1I3o1qL12q PeWXA0Mab2rDeJDZty4Hx7Nena9wT6eMtqnX+drwPt8oQ14WbnG4sGd88QLSEoQUSkiE+ChSY+r IiiIbLVC30WWRV4VQp/Oqy3nuXFkELHPLw961GJmJwLXNZQsaAY+jJA4pdQ5wswV03L7LF8SJA4 Fftw9aUMe6qxuqqPxAN/EY1NOTKAXuutzf6SGR5GOKcyK6ecwvLR9PXskOzJ73XeLNQRAwvolmx JFzf3wadrslGvVYkBw2R/N6/07UcZbDa4wzUCi3tdmG3v4D9lre0WTgkFV7ESJN50Lf7YLxPeTH Iby2CDOfy6cZbzruDb/L7opGiA3oZHW3iZVB3Qu4nA8iOyjwVpcl04t3rnFldolZAnTaHI5mbRY RtInhehCljidwa6/G5PYpDofMEC015lRro2eujdMCJFZ+bdMGig75RoqyvTS/CPI/FUT7J7ez7S Fg+0rNf4Smp8swp8sUw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-22_02,2026-06-22_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606220147 Many vendor drivers have requirements to send a raw HCI reset synchronously with HCI_INIT_TIMEOUT. Add a dedicated API for them to use. Signed-off-by: Zijun Hu --- include/net/bluetooth/hci_sync.h | 1 + net/bluetooth/hci_sync.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/net/bluetooth/hci_sync.h b/include/net/bluetooth/hci_sync.h index 73e494b2591d..7005fc9f257a 100644 --- a/include/net/bluetooth/hci_sync.h +++ b/include/net/bluetooth/hci_sync.h @@ -59,6 +59,7 @@ int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen, int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen, const void *param, u8 event, u32 timeout, struct sock *sk); +int __hci_reset_sync(struct hci_dev *hdev); int hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen, const void *param, u32 timeout); diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 601d44ef975f..40c9725585cb 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -3684,6 +3684,20 @@ int hci_reset_sync(struct hci_dev *hdev) return -bt_to_errno(err); } +/* Send a raw HCI reset for use by vendor drivers */ +int __hci_reset_sync(struct hci_dev *hdev) +{ + int err; + + err = __hci_cmd_sync_status(hdev, HCI_OP_RESET, 0, NULL, + HCI_INIT_TIMEOUT); + if (err < 0) + return err; + + return -bt_to_errno(err); +} +EXPORT_SYMBOL(__hci_reset_sync); + static int hci_init0_sync(struct hci_dev *hdev) { int err; -- 2.34.1