From patchwork Wed Jan 24 14:30:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janaki Ramaiah Thota X-Patchwork-Id: 765684 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 38C47132C00; Wed, 24 Jan 2024 14:31:06 +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=1706106668; cv=none; b=NDCDYM1rFagAXas8PxTlrvMPCOZ/eFJcOSIBfBPUqAx7jMyjlL1healx7fdevZunS8tTLHBlQjnA05GJ84E9xE57qGdq7MrHF/56vHxakN+53qiheyEh0FjmDuQ6+rHZLGQ2USTB2+olWSW19urd8YG9d3glLedMCZS5XnIGlwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706106668; c=relaxed/simple; bh=ruhqYG75t7/UEmAoJwOenf32CdfU8FzhLCozj+uXgds=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ah/wh1+fx60IBOKICo2/AU2HkmYgI+BipZHP1hxt5Qeq5yHdyRd8fEWJdicbTM6HYwaaINC/UjSCK+88ZfQ0CVIpIX6LcdHC4yaenYxf8rJ3Dq/jZEvSxkj+nOsSRL403ENycd2konRDxlxJa/E1Lcp7WUYhrHN0AaNdNi4KD4Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=dm7veX6v; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="dm7veX6v" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40OCel7D026053; Wed, 24 Jan 2024 14:31:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=qcppdkim1; bh=l4V0st4SQHaLxMTIgnHL zaU45ue1oKK4zA0OU8lqL7k=; b=dm7veX6vLlNsUre82RVF44hehjLgueYY8g4K IpbDNXYJpF8v230Vy2ZC+K6lHRa7V2UPSRWxDjgAt6EJWySkfwotVkdYgcUQJNS+ c4I75YZZQTwtW0nOIGqrqx9nIL5OV0GamHffFQHurRqh7MIN6tBzpNQ0v6pRjZNG 1E711JNbrAGCQcv+Dz3h5XSDVmESO1S5sNq5oQBit/lG9K/PK5zASAa8Nrx7Jamq aDiUeAdudi3Zdp/PyKU4iW4vH9uCkpAeGEtn2Cqst4gU9xKWm1/o1rOmGv5ZvvyJ 0WV7SnIJg99KxGVTp7LpBQavSINPesPE0iXkWs5VODgutqXarw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vtyf78na1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 14:31:02 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40OEV1bQ028189 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 14:31:01 GMT Received: from hu-janathot-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 24 Jan 2024 06:30:59 -0800 From: Janaki Ramaiah Thota To: Marcel Holtmann , Luiz Augusto von Dentz , Balakrishna Godavarthi CC: , , , Subject: [PATCH v2 1/1] Bluetooth: hci_qca: Set BDA quirk bit if fwnode exists in DT Date: Wed, 24 Jan 2024 20:00:42 +0530 Message-ID: <20240124143042.27790-2-quic_janathot@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240124143042.27790-1-quic_janathot@quicinc.com> References: <20240124143042.27790-1-quic_janathot@quicinc.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: shguZOhcnPf6qcrZ7jjKGi2SKOHtUjP2 X-Proofpoint-ORIG-GUID: shguZOhcnPf6qcrZ7jjKGi2SKOHtUjP2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-24_06,2024-01-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 adultscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 impostorscore=0 phishscore=0 clxscore=1015 mlxscore=0 mlxlogscore=972 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2401240105 BT adapter going into UNCONFIGURED state during BT turn ON when devicetree has no local-bd-address node. Bluetooth will not work out of the box on such devices, to avoid this problem, added check to set HCI_QUIRK_USE_BDADDR_PROPERTY based on local-bd-address node entry. When this quirk is not set, the public Bluetooth address read by host from controller though HCI Read BD Address command is considered as valid. Fixes: e668eb1e1578 ("Bluetooth: hci_core: Don't stop BT if the BD address missing in dts") Signed-off-by: Janaki Ramaiah Thota --- drivers/bluetooth/hci_qca.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 94b8c406f0c0..06193546ebb6 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -7,6 +7,7 @@ * * Copyright (C) 2007 Texas Instruments, Inc. * Copyright (c) 2010, 2012, 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Acknowledgements: * This file is based on hci_ll.c, which was... @@ -1904,7 +1905,17 @@ static int qca_setup(struct hci_uart *hu) case QCA_WCN6750: case QCA_WCN6855: case QCA_WCN7850: - set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); + + /* Set BDA quirk bit for reading BDA value from fwnode property + * only if that property exist in DT. + */ + if (fwnode_property_present(dev_fwnode(hdev->dev.parent), "local-bd-address")) { + set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); + bt_dev_info(hdev, "setting quirk bit to read BDA from fwnode later"); + } else { + bt_dev_dbg(hdev, "local-bd-address` is not present in the devicetree so not setting quirk bit for BDA"); + } + hci_set_aosp_capable(hdev); ret = qca_read_soc_version(hdev, &ver, soc_type);