From patchwork Mon Dec 9 09:42:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13899149 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2058.outbound.protection.outlook.com [40.107.22.58]) (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 54CAE2163A4 for ; Mon, 9 Dec 2024 09:42:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733737352; cv=fail; b=WWwAVBaosxpITCgYonYrGGVf+P0cMrjtDhihKN+3d8U16R453kX69uysscMBYJ6JkLFj/z8JjppHQKFZDi25ku+exwitTv99bKitGAmKI+nZNq9u+jT6a3++SYc5wpdeSMbshwxfBCKPF+wuAIfkFFccKTp7olwKe9g0eIw2ktU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733737352; c=relaxed/simple; bh=L17dOwBX0MarJPVyTZDhSk46ve1EzRERqQszQx8pdeU=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=td45HAiqhRIPSh0lElNmV0Oo8wHr8H+2/026N7BUcMuwkiuUtgKD5pFcuk0SwpPf+JwNCodk+0TV+WN9Kjl8werCCx3/G00VIw3IvgB6Yp/RpK9h1rSBLAuank2iTeTXxwkki3fltI04TXXdRNK9fkgx02t00kQiBB1CgN0CdqU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=eaS6do5a; arc=fail smtp.client-ip=40.107.22.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="eaS6do5a" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nawgTANsEdhTI+yOyXIXRmYVofOssfvEy2fh/ifvuTZab8nuDpMMulu/Lpcw3Ka2PxGBKW3GMca2gaYawuOEdRi2nFeSPVVrn9/PN1PkNj6DDSL66kookjx2BWCJSN7Xd08gt8jtziyqPWjzwUpZu7dVZGObJ74oKeaBU033IWIWCgieFGXCetFuJSydsY4v+VGHLxsdJV3UFOC8AtMbnIkowiqBM0yEyHNk3tsDL9yvscCS+eaRc/acjaeWJz/yyKbgSiRiKsYFr2QPK1rFCbEp94BQ+BqHnHgfQZBd9DyQAi/gp1Dt6IU67GxxS89sc6oHzjDmBcPhHhCIlFnMGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5ulTC6pqqXjOO6w2NC7MNEdjXaVqcbmbHYa1fvk/E5w=; b=gl3UC+iT1eWby5SpAfcFhc2MllZAbtLjMoO8FPacpkVlnkXRXvl2K+0RuVcWjrfKoojHZtXxUfhV0ix9ZaEtE677exk2k7abXuS31ojKNaOc6bMWMefVrwIgMyITTvJMHLBBHvlREADnKTRB6MXFRx7uS4qAlnSA6KSbG+ApV5FGmIYPkhPl8sBqCdg/WccGwYEFVrUYDAYNqF35S58aT4fzHLRDVBDBHgaB5NvLwpL+wAomOsKz/adiN5qAZIHwL9jAjn7qlUGEtFE3yvZ47PElkgMvtfGNk2gtmpHglyhSnvpG6gZL0nsroy1Z82cyI0gADcfIABIGI2qQYhKBYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5ulTC6pqqXjOO6w2NC7MNEdjXaVqcbmbHYa1fvk/E5w=; b=eaS6do5aWuXBZ8DX9fpyE+HRmytaEAdtlBi/HGCEU/KxfNn+X28dtxdr7GggXpucQRuaOen4EqAT1/tYuHNQx1/nyq/PUTD/M8tEQKgGqS6lVyfzyYorTfRenOgXoj6ACT7DYV7Uh2z99/wVgGJuVJXryr+yfvSmwOweMpA/MEroBYjGwarPqX4P90Zru1Ufl8vzDkk6gp0n3+RxjvoZl7wCI+Sn634sVVkP8tEBVFJ7ivSJp0WvvYMleqAijh2DyeRFE0qcQf54pEZC0dYXIXsHQFdZAESkqvfrn0dCizlRrK2X5yTy+w2IiQUQ9nyA0gEd/0mNH2a15URClwf0Bw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by VI1PR04MB7086.eurprd04.prod.outlook.com (2603:10a6:800:121::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Mon, 9 Dec 2024 09:42:26 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8230.010; Mon, 9 Dec 2024 09:42:26 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH v2 0/2] Bluetooth: iso: Fix circular lock warnings Date: Mon, 9 Dec 2024 11:42:16 +0200 Message-ID: <20241209094218.4939-1-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: AM4PR07CA0017.eurprd07.prod.outlook.com (2603:10a6:205:1::30) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VI1PR04MB7086:EE_ X-MS-Office365-Filtering-Correlation-Id: 1eb8d065-3fb1-4fde-e7c6-08dd1835ca79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: jvQhM7KRsjj5pScXgMmq49l+3shGs9uPWfLi8PigJ/xJrTuwL9DJfI88O+vPLT++hyVoMwMyC4axstECSGn1gWWd5IlNeWTj0a2mWAGv56eBWqIzdg9m6vpjJ4yB5FGqfT3n9JPIpk+WpYWLtCz99F00ovuLocfJB8Y/vgK/JSrU69/wbZykHPaf/AUp4TuNitWCDLbueWlhxYpDkZsCMF2/3953lWDBGFAfj1gpyF2dKuO9pcNVQ0M5JV8WR0xp1CTPiOs2VIxN7Y4uQ+5/uMH0dbGZsSt8IkJelZ7Pp6+tQAvBKeRegQCfWh/ZEX3NXRbG9ig+HpAV6gDNJiB0e/EHIUr/DyQVRTLMawD2fC4wH8JEjavcsMsoRSHGhWKGninee+EbHGUIzaMZO5+MFEpeBS1DwrG6kr+HF3wThAD9s2QloWXXdPkVpfRgsDB//p9XpetayFVhaJz1Es5xebW+HZyAN6zL++vk59Te+8lYCuelwGvkG/W8JFdtCd8nzVLRPNRF8EagEb4/m1R/6FA69k5lKhqJc7RbS3rVIoJZMBXTz0hE1apMHWuOTGgETUM58PMvoDuTU1H97zYDPWN+8N6m0CIz1M5ZvqmmqGcGveYDE/AZmsmcL/H/22tHHaRZ0EIkEn3IsbhzWxM525UnQFQFrdCClEoIchW02G3B4k50uLG8O+paSNu0CdzvtkOVEiFCrLHkBU8ZybGagXTky/L4grpnJL2tQ1LS+b+ot27BKfMwdjAllE3Vc6KBaCG8tIk+EXjFrhxnh5VpPhFcW3W1FELAKiB5dF+qLtl/iN2IqA8hx/jcMjX1eNSzuViSu1incMZnu0kGEdagfz9AVimxvzYaXG7lzi9QnNCUSjrPHJyiNKp1/ozTVnk5Ap3sastQ3w4tKZtoARcrozyRpNWBmwKzZjiJwjZNpwollSddu7aKgh591smQ/J/whfwT1lA6UoyTC5bhRMSSV4K1QfPOTz7R6nnaEdietYUzAvCEGtrft6xkTwg51NtBsMyl+ZxsKK8KeMrZt6oNX5wKdKLesYbR/H6BG8Vk4ueOvNgXwujh/y1oen3zdyV+FlKj/37NHJZxJ0e0o/QMdUS5hfsNRyIVVFLwV1k1WdwqrR+tQnVkBqTJplMo/Ytu4AQkhNCCtef6jFd8af6p63+trJuzvny/AL+hSNR1xShBezt3BPN+Orv3yZiXlodVBplqFy/fLKbcohMIysfiuJqrq4henssWwPO5WIbvMP8tz+PRbaEcQSYuLh7bHktz6YWmZZe/5TR51gWxkoQ9azNLs52XEWICg56R0IeB+P5pl8MHo7Hob1NJGJ1YZJIQdPmBvs4N6AFqQ2autbFPug== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8898.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QafQrvfBvsuvN9dBESrkQ2qr5VtVj4dJ1RXRIl6xvldy+486g/n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+5iS+/W2CiMUWrL3Og7Qt4AAvneA36gqyEk3b/BfkkRnh1aKQU4lvVl/fjMPYNe3wTPV26Mh3ZVm3e9Lr99T8LVDEkVYFO9lbREtADgz65rfh7bnv52ehkuz20+uLuSmUvlvS7FAGEdY80s8IV3Nejju4iJm2gzgf7u4OWiZPTCN5xh4vx6qNZ6jxRMDRq4K01zGFPeJV2/wNyJkSRBQQP3nLmV+tpSSIFs97ebGrlJfEhlOjbMgc8nt+d6kTWyPmeL0J1xTwscHhR0JCiKp/btl0Mfv4CEUE2lT6iMV7pQi4I9UZLl/rpO+ZaQX7Vm10TMEiw1WhPUAwV1yI+6Tmaph+LhicXsRW9MG3JZqhYqUedmrFcnH+XPGZGrzNy/F++VzEs/vfbGhGhOBp8ErqiHhJ8S7NKa7ViH66twgqiycC58OabExPYW6kn5DHkPDvbddMZPbbHaRti/alWNQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1eb8d065-3fb1-4fde-e7c6-08dd1835ca79 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2024 09:42:26.6946 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7n0oRKWTf53o2c7TQnaDcwf8C5Gfj/I3UheUygZ5cz37ZytX+ofP+az2SXHrgG4VLXMNx7Z7JWKVBTnK6LHmsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7086 This patch fixes the circular locking dependency warnings in iso.c, caused by A->B/B->A type lock ordering with sk and hdev. The first commit fixes the warning caused by iso_listen_bis, by releasing sk lock before entering the function and acquiring hdev lock. The second commit fixes the warning caused by iso_conn_big_sync. This reworks iso_sock_recvmsg, since it contains multiple function calls that need sk lock to be released: The socket needs to be kept alive with sock_hold before being released. To avoid multiple hold/release/lock/put calls, the socket is grabbed and locked at the beginning of the switch, and it is released and ungrabbed at the end, with release/lock calls when necessary in the switch. Iulia Tanasescu (2): Bluetooth: iso: Fix circular lock in iso_listen_bis Bluetooth: iso: Fix circular lock in iso_conn_big_sync net/bluetooth/iso.c | 48 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) base-commit: 269f7b219173ffbb01121243c55cef8a5503593b