From patchwork Fri May 17 09:54:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K, Kiran" X-Patchwork-Id: 797717 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 2D0A123758 for ; Fri, 17 May 2024 09:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715938830; cv=none; b=HTXQpsp3pYS7AoGi3g+sR3Jb58tWKf7jOv+RDG1mMBPLCB9zQUSnFhouQ/TG9AkXuvewgqGFDKK5Wqzl+JaK1vSB8AwyxrmfFoPo+YJetJbdk4ygxp2aFD8hdwJsCIT4ywH2gGDgyhNAdZ+iVjqwWyYca1Wz95tlDfsYbX1sudo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715938830; c=relaxed/simple; bh=rB3jjjd3wldD/dxe9C5N3XXEIQUUHdWt3HUXovE9s98=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=nM73cJtqyRIErJ/06EDhnM/7QsewVVyhDm/GTjSL5tn6Q8uhPH8vbCZ2u7bpg6t0woGOjP9cSjhc1bjJ8+JC+ltpYGDjCandusNX4hZ+QdYig5e3srERJ4Hj1vyDiLzEUPFUHsvATUso/A6t4GpkDv3+xIY7t8gKI/FIQ7ADWXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kclLoSld; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kclLoSld" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715938828; x=1747474828; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=rB3jjjd3wldD/dxe9C5N3XXEIQUUHdWt3HUXovE9s98=; b=kclLoSldVJz+CLR7rLWfBn4UVOxu0fARqe0Xus+7sA+TvRn3MfKOoc7r 71Vfrb8h9lZ05DmuNOeE1rCnXTvnUXDQxs5bHv4jyTuTV3Bh3z/iWlupG XJ/i5O3TEro7PGyw6ymDy7XL6832zTgBkCpSQ5eHJjgwVPy/HMyNfyTHH gfudLlcdM7mRXkoQHytrYmq1pcxihGWeyopGBFnJ3EPxiHKkYuGdede+Q GiH2gDMbfYhQb6QdY/MhvcBU2y5IOaad+nGFLLfAzCn19lQ6jQy+bDvPP Jh/hRk3tMLJKncJfPKlzDJhzNDWRjUyn+9QEZhfsRWuMDgKFavc//hbXs Q==; X-CSE-ConnectionGUID: PiNxpDyIQBCxcgjYFPehyw== X-CSE-MsgGUID: 7rjk8hfzTv6Xa3nZ7IN7Mg== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11976642" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11976642" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:40:27 -0700 X-CSE-ConnectionGUID: U256kLRGRS6iGGW5VsnhBg== X-CSE-MsgGUID: SB9gOoetTgSblljhOauDYQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31676419" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by fmviesa007.fm.intel.com with ESMTP; 17 May 2024 02:40:23 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com, chandrashekar.devegowda@intel.com, vijay.satija@intel.com, Kiran K Subject: [PATCH v3 1/3] Bluetooth: btintel_pcie: Print Firmware Sequencer information Date: Fri, 17 May 2024 15:24:45 +0530 Message-Id: <20240517095447.956132-1-kiran.k@intel.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Firmware sequencer (FSEQ) is a common code shared across Bluetooth and Wifi. Printing FSEQ will help to debug if there is any mismatch between Bluetooth and Wifi FSEQ. Make 'btintel_print_fseq_info' public and use it in btintel_pcie.c. dmesg: .... [ 5335.695740] Bluetooth: hci0: Device booted in 33872 usecs [ 5335.695918] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0190-0291.ddc [ 5335.697011] Bluetooth: hci0: Applying Intel DDC parameters completed [ 5335.697837] Bluetooth: hci0: Firmware timestamp 2024.20 buildtype 0 build 62871 [ 5335.697848] Bluetooth: hci0: Firmware SHA1: 0xeffdce06 [ 5335.698655] Bluetooth: hci0: Fseq status: Success (0x00) [ 5335.698666] Bluetooth: hci0: Fseq executed: 00.00.04.176 [ 5335.698670] Bluetooth: hci0: Fseq BT Top: 00.00.04.176 [ 5335.750204] Bluetooth: MGMT ver 1.22 Signed-off-by: Kiran --- drivers/bluetooth/btintel.c | 3 ++- drivers/bluetooth/btintel.h | 5 +++++ drivers/bluetooth/btintel_pcie.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index 0c855c3ee1c1..2c434ff9c47c 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -2713,7 +2713,7 @@ void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant) } EXPORT_SYMBOL_GPL(btintel_set_msft_opcode); -static void btintel_print_fseq_info(struct hci_dev *hdev) +void btintel_print_fseq_info(struct hci_dev *hdev) { struct sk_buff *skb; u8 *p; @@ -2825,6 +2825,7 @@ static void btintel_print_fseq_info(struct hci_dev *hdev) kfree_skb(skb); } +EXPORT_SYMBOL_GPL(btintel_print_fseq_info); static int btintel_setup_combined(struct hci_dev *hdev) { diff --git a/drivers/bluetooth/btintel.h b/drivers/bluetooth/btintel.h index b5fea735e260..9dbad1a7c47c 100644 --- a/drivers/bluetooth/btintel.h +++ b/drivers/bluetooth/btintel.h @@ -244,6 +244,7 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev, struct intel_version_tlv *ver); int btintel_shutdown_combined(struct hci_dev *hdev); void btintel_hw_error(struct hci_dev *hdev, u8 code); +void btintel_print_fseq_info(struct hci_dev *hdev); #else static inline int btintel_check_bdaddr(struct hci_dev *hdev) @@ -373,4 +374,8 @@ static inline int btintel_shutdown_combined(struct hci_dev *hdev) static inline void btintel_hw_error(struct hci_dev *hdev, u8 code) { } + +static inline void btintel_print_fseq_info(struct hci_dev *hdev) +{ +} #endif diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 5b6805d87fcf..8d282ee2322c 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -1197,9 +1197,11 @@ static int btintel_pcie_setup(struct hci_dev *hdev) bt_dev_err(hdev, "Unsupported Intel hw variant (%u)", INTEL_HW_VARIANT(ver_tlv.cnvi_bt)); err = -EINVAL; + goto exit_error; break; } + btintel_print_fseq_info(hdev); exit_error: kfree_skb(skb); From patchwork Fri May 17 09:54:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K, Kiran" X-Patchwork-Id: 797493 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 B13F42561D for ; Fri, 17 May 2024 09:40:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715938831; cv=none; b=Tqb1zm1jZHqJcd9i/vPahVLCsldXsRxH+o+nyEiWvn+6T52axJl8x1Gg8QUFAyIei9vPuYO9EUbQSarUExGXG3YvTuavysj5qP0V2ZoTW0Hd9112Jkp0xykweU3q9jYCa+YLogssQRmb6RA3zhFhRrbiECC+R7dvctY7KZ5prnE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715938831; c=relaxed/simple; bh=r4l/mTS+Vd9XiXbtciJInuK5e3zeGDqb618TRLJZS2s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jsLVAepibMcygtTEcl4grCQJ5wlBfoyN4W0i+jhgqosBDs9sYud+PzrfIHzQI+CXDtBQmNKj4xWo/tU2eHhJRILZvt8yqGSrsbXArm6AhM1dql8RPHri+FkMnrNnpcAnq8S2FfkNjV+5xkf257aKzknWjeaLBLR+EQoM3RVd/mU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=PY83nQLo; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PY83nQLo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715938830; x=1747474830; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r4l/mTS+Vd9XiXbtciJInuK5e3zeGDqb618TRLJZS2s=; b=PY83nQLoSnfoc8F7q5khQSwGAjq8//Bpleuy+hGJp6d8nGh86NHbc4uV pTfaRifQbUz0aMZ5yrHHtq4EWBxPEp8kIQBFGTWU2Tk9T0wYo0NtC0RO9 uYqQv2eswRGczLEWQ7dDKUxOGDu7cUSN/Otxb1d7nESIgknrBNV6sYzBT J2JncKW+DJLKLGWo9DhEX6KRG9Uf/yAbCof2tzrRkZEYqiga0hzIr/xaA mWeYaCz5p9Ddng2jKRhkBaNgzla1k5NZ6PBqnHe4z6DH4xJL3g5YNoAR6 WmRDrfxWk43GIKXl+7vqJ+xAZVI4xCCe4yKxlMIJYLk8R1aY7lJMIiJxB Q==; X-CSE-ConnectionGUID: d1V7eEmsT/y9J7VNkm0b5Q== X-CSE-MsgGUID: xWG9voB5R8KZ+NIVBIhhZQ== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11976643" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11976643" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:40:27 -0700 X-CSE-ConnectionGUID: 9pTeSyODSiKqO6nJr08Zyg== X-CSE-MsgGUID: uQNantj+Qx+Je3gzlGqo/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31676452" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by fmviesa007.fm.intel.com with ESMTP; 17 May 2024 02:40:25 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com, chandrashekar.devegowda@intel.com, vijay.satija@intel.com, Kiran K Subject: [PATCH v3 2/3] Bluetooth: btintel_pcie: Fix irq leak Date: Fri, 17 May 2024 15:24:46 +0530 Message-Id: <20240517095447.956132-2-kiran.k@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240517095447.956132-1-kiran.k@intel.com> References: <20240517095447.956132-1-kiran.k@intel.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Free irq before releasing irq vector. Fixes: c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe transport") Signed-off-by: Kiran --- drivers/bluetooth/btintel_pcie.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 8d282ee2322c..d8f82e0f6435 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -1329,6 +1329,12 @@ static void btintel_pcie_remove(struct pci_dev *pdev) data = pci_get_drvdata(pdev); btintel_pcie_reset_bt(data); + for (int i = 0; i < data->alloc_vecs; i++) { + struct msix_entry *msix_entry; + + msix_entry = &data->msix_entries[i]; + free_irq(msix_entry->vector, msix_entry); + } pci_free_irq_vectors(pdev); From patchwork Fri May 17 09:54:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K, Kiran" X-Patchwork-Id: 797716 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 71C1C18C05 for ; Fri, 17 May 2024 09:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715938832; cv=none; b=IhBK+KPNdXyfwne8NQpXpEg1Z752GlFK+4OfwqcwEhfhFrWHS/p85LQvIqsK4bwTWN9B5tXgC6+Ss7vNtRjBc13pkKmwbVNcaH2hb90hKDFVReNmr4ZjltKI6j2m+IfInihbo5hrFhOou9NJb42At/NCeBF83Dkqhj5xbx7r+4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715938832; c=relaxed/simple; bh=UelzzseOVEb5xnEvTVZqUl1Wg2Y8s5/14CVh7FmByKc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FKqdgzn6SCP+GYbMMwN0CyjADHDEA3t+b7JT3SE/q/clsjaDMUxmKWS34pwFQKI4mS2Zcj2M7wZ5UdTMs/jSGCw4tx/2I+XZKAFAo3DKuF8vQEnNaXBDuapV8VDThhn4iCanuYo1/esjZ9/sTpK5n08BoEPc8QddJgSom/azsk8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gN/RDQ79; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gN/RDQ79" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715938830; x=1747474830; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UelzzseOVEb5xnEvTVZqUl1Wg2Y8s5/14CVh7FmByKc=; b=gN/RDQ79v7FJ3ayX846YhDBuW0p9CZWYdnt7zWAzfb83Ht3HipAm+2iv rRO69yAkKgEZ14Cj0tlX5VtpPrPUAEWvVm6jckoBpgeXc6b/0/Xnmd177 86x0NYb9XOHl4QFMGGRhHd02UtV3LS6XNlhYTQ75D1ullTLMbHOd2xlBK WzF35ROWtxYRtbYnp5fZe+mV+C4Wq0aajGBSpgJG0QdHuf/YeQD6UcLWU Ygjl6d0/KP1G58+V3FvcJKt2jtX2ibGAQr0DmtzeLLl0jyYqvQeLVj2ev SVq+LpGyiqpEg69hRC1ZFuAV2Pf/S8OTY2CG1mJDee4s3jWjCmrh/Bgkd g==; X-CSE-ConnectionGUID: q+ruA1LuSTGKJ1VoPG9nww== X-CSE-MsgGUID: DoO2b/rTTs2Lp42LwioDxg== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11976648" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11976648" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:40:29 -0700 X-CSE-ConnectionGUID: aRtrK44KRaWZ3ZfXI3MsDA== X-CSE-MsgGUID: 06p2covwRWCpyWtomCvLDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31676478" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by fmviesa007.fm.intel.com with ESMTP; 17 May 2024 02:40:27 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com, chandrashekar.devegowda@intel.com, vijay.satija@intel.com, Kiran K Subject: [PATCH v3 3/3] Bluetooth: btintel_pcie: Fix REVERSE_INULL issue reported by coverity Date: Fri, 17 May 2024 15:24:47 +0530 Message-Id: <20240517095447.956132-3-kiran.k@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240517095447.956132-1-kiran.k@intel.com> References: <20240517095447.956132-1-kiran.k@intel.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vijay Satija check pdata return of skb_pull_data, instead of data. Fixes: c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe transport") Signed-off-by: Vijay Satija Signed-off-by: Kiran K --- drivers/bluetooth/btintel_pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index d8f82e0f6435..58144c82b1cb 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -382,7 +382,7 @@ static int btintel_pcie_recv_frame(struct btintel_pcie_data *data, /* The first 4 bytes indicates the Intel PCIe specific packet type */ pdata = skb_pull_data(skb, BTINTEL_PCIE_HCI_TYPE_LEN); - if (!data) { + if (!pdata) { bt_dev_err(hdev, "Corrupted packet received"); ret = -EILSEQ; goto exit_error;