From: kernel test robot <lkp@intel.com>
To: Kiran K <kiran.k@intel.com>, linux-bluetooth@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
chethan.tumkur.narayan@intel.com,
chandrashekar.devegowda@intel.com, ravindra@intel.com,
Kiran K <kiran.k@intel.com>
Subject: Re: [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests
Date: Tue, 24 Nov 2026 04:44:35 +0800 [thread overview]
Message-ID: <20261124043547.lzdrjg8w-lkp@intel.com> (raw)
In-Reply-To: <20261123065523.2769017-3-kiran.k@intel.com>
Hi Kiran,
kernel test robot noticed the following build warnings:
[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on next-20261123]
[cannot apply to linus/master v7.4-rc4]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kiran-K/Bluetooth-btintel_pcie-Serialize-doorbell-writes-and-target-reads/20261123-122522
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link: https://lore.kernel.org/r/20261123065523.2769017-3-kiran.k%40intel.com
patch subject: [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20261124/20261124043547.lzdrjg8w-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 2012344e5da8e03ea4b8283ecd6fad6e13f09d64)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261124/20261124043547.lzdrjg8w-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261124043547.lzdrjg8w-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/bluetooth/btintel_pcie.c:1053:12: warning: mutex 'data->mac_access_lock' is not held on every path through here [-Wthread-safety-analysis]
1053 | for (i = 0; i < config_set->num_pairs; i++) {
| ^
drivers/bluetooth/btintel_pcie.c:1038:4: note: mutex acquired here
1038 | mutex_lock(&data->mac_access_lock);
| ^
include/linux/mutex.h:193:26: note: expanded from macro 'mutex_lock'
193 | #define mutex_lock(lock) mutex_lock_nested(lock, 0)
| ^
>> drivers/bluetooth/btintel_pcie.c:1111:4: warning: releasing mutex 'data->mac_access_lock' that was not held [-Wthread-safety-analysis]
1111 | mutex_unlock(&data->mac_access_lock);
| ^
2 warnings generated.
vim +1053 drivers/bluetooth/btintel_pcie.c
50932a1567d614c Ajaykv 2026-11-11 1000
68e0925f16c028a Ajaykv 2026-11-11 1001 static void
68e0925f16c028a Ajaykv 2026-11-11 1002 btintel_pcie_apply_yoyo_config_sets(struct btintel_pcie_data *data,
68e0925f16c028a Ajaykv 2026-11-11 1003 u32 time_point)
68e0925f16c028a Ajaykv 2026-11-11 1004 {
68e0925f16c028a Ajaykv 2026-11-11 1005 struct btintel_pcie_yoyo_config_set *config_set;
68e0925f16c028a Ajaykv 2026-11-11 1006 resource_size_t bar0_len;
68e0925f16c028a Ajaykv 2026-11-11 1007 int ret;
68e0925f16c028a Ajaykv 2026-11-11 1008 u32 i;
68e0925f16c028a Ajaykv 2026-11-11 1009
68e0925f16c028a Ajaykv 2026-11-11 1010 if (!data)
68e0925f16c028a Ajaykv 2026-11-11 1011 return;
68e0925f16c028a Ajaykv 2026-11-11 1012
68e0925f16c028a Ajaykv 2026-11-11 1013 /* Get the length of PCI BAR0 */
68e0925f16c028a Ajaykv 2026-11-11 1014 bar0_len = pci_resource_len(data->pdev, 0);
68e0925f16c028a Ajaykv 2026-11-11 1015
68e0925f16c028a Ajaykv 2026-11-11 1016 if (!data->yoyo.enabled)
68e0925f16c028a Ajaykv 2026-11-11 1017 return;
68e0925f16c028a Ajaykv 2026-11-11 1018
68e0925f16c028a Ajaykv 2026-11-11 1019 list_for_each_entry(config_set, &data->yoyo.config_set_list, list) {
68e0925f16c028a Ajaykv 2026-11-11 1020 u32 pair_addr, addr, value;
68e0925f16c028a Ajaykv 2026-11-11 1021
68e0925f16c028a Ajaykv 2026-11-11 1022 if (config_set->time_point != time_point)
68e0925f16c028a Ajaykv 2026-11-11 1023 continue;
68e0925f16c028a Ajaykv 2026-11-11 1024
68e0925f16c028a Ajaykv 2026-11-11 1025 switch (config_set->config_set_type) {
68e0925f16c028a Ajaykv 2026-11-11 1026 case BTINTEL_PCIE_CFGSET_CSR:
68e0925f16c028a Ajaykv 2026-11-11 1027 case BTINTEL_PCIE_CFGSET_PERIPH_MAC:
68e0925f16c028a Ajaykv 2026-11-11 1028 case BTINTEL_PCIE_CFGSET_DEVICE_MEM:
68e0925f16c028a Ajaykv 2026-11-11 1029 break;
68e0925f16c028a Ajaykv 2026-11-11 1030 default:
68e0925f16c028a Ajaykv 2026-11-11 1031 BT_WARN("YoYo: unknown/unsupported config_set type %u, skipping",
68e0925f16c028a Ajaykv 2026-11-11 1032 config_set->config_set_type);
68e0925f16c028a Ajaykv 2026-11-11 1033 continue;
68e0925f16c028a Ajaykv 2026-11-11 1034 }
68e0925f16c028a Ajaykv 2026-11-11 1035
68e0925f16c028a Ajaykv 2026-11-11 1036 if (config_set->config_set_type == BTINTEL_PCIE_CFGSET_PERIPH_MAC ||
68e0925f16c028a Ajaykv 2026-11-11 1037 config_set->config_set_type == BTINTEL_PCIE_CFGSET_DEVICE_MEM) {
1151389a60ccbe5 Kiran K 2026-11-23 1038 mutex_lock(&data->mac_access_lock);
68e0925f16c028a Ajaykv 2026-11-11 1039 ret = btintel_pcie_get_mac_access(data);
68e0925f16c028a Ajaykv 2026-11-11 1040 if (ret) {
68e0925f16c028a Ajaykv 2026-11-11 1041 BT_WARN("YoYo: MAC access failed for config set (%d), skipping",
68e0925f16c028a Ajaykv 2026-11-11 1042 ret);
68e0925f16c028a Ajaykv 2026-11-11 1043 /* get_mac_access() asserts MAC_ACCESS_REQ before it
68e0925f16c028a Ajaykv 2026-11-11 1044 * polls, and leaves it set on timeout; drop it so the
68e0925f16c028a Ajaykv 2026-11-11 1045 * request bit is not leaked.
68e0925f16c028a Ajaykv 2026-11-11 1046 */
68e0925f16c028a Ajaykv 2026-11-11 1047 btintel_pcie_release_mac_access(data);
1151389a60ccbe5 Kiran K 2026-11-23 1048 mutex_unlock(&data->mac_access_lock);
68e0925f16c028a Ajaykv 2026-11-11 1049 continue;
68e0925f16c028a Ajaykv 2026-11-11 1050 }
68e0925f16c028a Ajaykv 2026-11-11 1051 }
68e0925f16c028a Ajaykv 2026-11-11 1052
68e0925f16c028a Ajaykv 2026-11-11 @1053 for (i = 0; i < config_set->num_pairs; i++) {
68e0925f16c028a Ajaykv 2026-11-11 1054 pair_addr = get_unaligned_le32(&config_set->pairs[i].address);
68e0925f16c028a Ajaykv 2026-11-11 1055
68e0925f16c028a Ajaykv 2026-11-11 1056 /* Calculate the effective address by adding the address offset */
68e0925f16c028a Ajaykv 2026-11-11 1057 if (check_add_overflow(pair_addr, config_set->addr_offset, &addr)) {
68e0925f16c028a Ajaykv 2026-11-11 1058 BT_WARN("YoYo: config set address overflow (0x%08x + 0x%08x)",
68e0925f16c028a Ajaykv 2026-11-11 1059 pair_addr, config_set->addr_offset);
68e0925f16c028a Ajaykv 2026-11-11 1060 continue;
68e0925f16c028a Ajaykv 2026-11-11 1061 }
68e0925f16c028a Ajaykv 2026-11-11 1062
68e0925f16c028a Ajaykv 2026-11-11 1063 value = get_unaligned_le32(&config_set->pairs[i].value);
68e0925f16c028a Ajaykv 2026-11-11 1064
68e0925f16c028a Ajaykv 2026-11-11 1065 switch (config_set->config_set_type) {
68e0925f16c028a Ajaykv 2026-11-11 1066 /* Direct Address Access (CSR) */
68e0925f16c028a Ajaykv 2026-11-11 1067 case BTINTEL_PCIE_CFGSET_CSR:
68e0925f16c028a Ajaykv 2026-11-11 1068 /* Validate the effective address for CSR access (Direct Address)
68e0925f16c028a Ajaykv 2026-11-11 1069 * addr not aligned to 4 bytes or exceeds the BAR0 length
68e0925f16c028a Ajaykv 2026-11-11 1070 */
68e0925f16c028a Ajaykv 2026-11-11 1071 if ((addr & (sizeof(u32) - 1)) ||
68e0925f16c028a Ajaykv 2026-11-11 1072 bar0_len < sizeof(u32) ||
68e0925f16c028a Ajaykv 2026-11-11 1073 addr > bar0_len - sizeof(u32)) {
68e0925f16c028a Ajaykv 2026-11-11 1074 BT_WARN("YoYo: bad CSR address 0x%08x for BAR0 length %llu",
68e0925f16c028a Ajaykv 2026-11-11 1075 addr, (unsigned long long)bar0_len);
68e0925f16c028a Ajaykv 2026-11-11 1076 continue;
68e0925f16c028a Ajaykv 2026-11-11 1077 }
68e0925f16c028a Ajaykv 2026-11-11 1078
68e0925f16c028a Ajaykv 2026-11-11 1079 BT_DBG("YoYo: CSR write [0x%08x] = 0x%08x", addr, value);
6df2b5e2ac4b8a1 Kiran K 2026-11-23 1080 /* addr may be PRPH_DEV_* or HBUS_TARG_WRPTR */
6df2b5e2ac4b8a1 Kiran K 2026-11-23 1081 spin_lock(&data->dev_mem_lock);
68e0925f16c028a Ajaykv 2026-11-11 1082 btintel_pcie_wr_reg32(data, addr, value);
6df2b5e2ac4b8a1 Kiran K 2026-11-23 1083 spin_unlock(&data->dev_mem_lock);
68e0925f16c028a Ajaykv 2026-11-11 1084 break;
68e0925f16c028a Ajaykv 2026-11-11 1085 /* Indirect Address Access (Peripheral MAC and Device Memory) */
68e0925f16c028a Ajaykv 2026-11-11 1086 case BTINTEL_PCIE_CFGSET_PERIPH_MAC:
68e0925f16c028a Ajaykv 2026-11-11 1087 case BTINTEL_PCIE_CFGSET_DEVICE_MEM:
68e0925f16c028a Ajaykv 2026-11-11 1088 /* The config-set TLV comes from an untrusted external file;
68e0925f16c028a Ajaykv 2026-11-11 1089 * reject null or unaligned targets.
68e0925f16c028a Ajaykv 2026-11-11 1090 */
68e0925f16c028a Ajaykv 2026-11-11 1091 if (!addr || (addr & (sizeof(u32) - 1))) {
68e0925f16c028a Ajaykv 2026-11-11 1092 BT_WARN("YoYo: bad indirect address 0x%08x for type %u",
68e0925f16c028a Ajaykv 2026-11-11 1093 addr, config_set->config_set_type);
68e0925f16c028a Ajaykv 2026-11-11 1094 continue;
68e0925f16c028a Ajaykv 2026-11-11 1095 }
68e0925f16c028a Ajaykv 2026-11-11 1096
6df2b5e2ac4b8a1 Kiran K 2026-11-23 1097 btintel_pcie_wr_dev_mem(data, addr, value);
68e0925f16c028a Ajaykv 2026-11-11 1098 BT_DBG("YoYo: indirect write type %u addr 0x%08x value 0x%08x",
68e0925f16c028a Ajaykv 2026-11-11 1099 config_set->config_set_type, addr, value);
68e0925f16c028a Ajaykv 2026-11-11 1100 break;
68e0925f16c028a Ajaykv 2026-11-11 1101 default:
68e0925f16c028a Ajaykv 2026-11-11 1102 BT_WARN("YoYo: unknown config_set type %u",
68e0925f16c028a Ajaykv 2026-11-11 1103 config_set->config_set_type);
68e0925f16c028a Ajaykv 2026-11-11 1104 break;
68e0925f16c028a Ajaykv 2026-11-11 1105 }
68e0925f16c028a Ajaykv 2026-11-11 1106 }
68e0925f16c028a Ajaykv 2026-11-11 1107
68e0925f16c028a Ajaykv 2026-11-11 1108 if (config_set->config_set_type == BTINTEL_PCIE_CFGSET_PERIPH_MAC ||
1151389a60ccbe5 Kiran K 2026-11-23 1109 config_set->config_set_type == BTINTEL_PCIE_CFGSET_DEVICE_MEM) {
68e0925f16c028a Ajaykv 2026-11-11 1110 btintel_pcie_release_mac_access(data);
1151389a60ccbe5 Kiran K 2026-11-23 @1111 mutex_unlock(&data->mac_access_lock);
1151389a60ccbe5 Kiran K 2026-11-23 1112 }
68e0925f16c028a Ajaykv 2026-11-11 1113 }
68e0925f16c028a Ajaykv 2026-11-11 1114 }
68e0925f16c028a Ajaykv 2026-11-11 1115
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2026-11-23 20:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 6:55 [PATCH v1 1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" Kiran K
2026-11-23 6:55 ` [PATCH v1 2/3] Bluetooth: btintel_pcie: Serialize doorbell writes and target reads Kiran K
2026-11-23 6:55 ` [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests Kiran K
2026-11-23 20:44 ` kernel test robot [this message]
2026-11-23 11:56 ` [v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" bluez.test.bot
2026-11-23 19:40 ` [PATCH v1 1/3] " patchwork-bot+bluetooth
2026-11-24 22:42 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124043547.lzdrjg8w-lkp@intel.com \
--to=lkp@intel.com \
--cc=chandrashekar.devegowda@intel.com \
--cc=chethan.tumkur.narayan@intel.com \
--cc=kiran.k@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=ravindra@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.