Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3073343rdh; Thu, 28 Sep 2023 01:29:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtjEtkbwFpNNSPcGGXv/+SKZH4dNIfWOmNqNxR8LXsk4n4v3U0PS6q/L12TCgg10gtzCO7 X-Received: by 2002:a25:c551:0:b0:d81:89e9:9f48 with SMTP id v78-20020a25c551000000b00d8189e99f48mr503237ybe.63.1695889781808; Thu, 28 Sep 2023 01:29:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695889781; cv=pass; d=google.com; s=arc-20160816; b=R8uqJduXUGoskDGOAYm1hup390GoQg5YG7GxBkkMvXAqyg+j4bKjgrmJZARBg/8T+i CdtNE6I5IrWH0zhYXdHD282lqwTRZ3488ub+ECW9CG8daHIAK0y5Xh+YbCnvgX7y/xab Sxns8OHf5bWdgw9JlGlH5N2Z5fHO6olT/+I2B+0eMvD0uVaUyZ6sJaxvdEkiLCZw4ASU ZQP3egxucSGW9TgQ6o7cKHSKJCS1nPmOqgZg6gONm6XASU7eo8Ai8RQYjm8cIb3iH+AH YGjDPII0AeMlMaLcuBfvdmOxO/S8Q/JEiAV6u+BFXkttua1kIVhIVwu9kPL7lt762Suh DhXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AGCq0uZNVAL6cvHEpISFPscV5DqgcKMJIFsRshWOVcw=; fh=gOZmdXQWWYi2KI/CDlaL8bHElbVrtxjT8kPXxzTdvp8=; b=UFcJLYyoX67dEnJNJ1B+qZMJlEWBO2iSYctbKH7Bt9E5T4s2wLwiQNyS2/e89qOtU+ SYQoNWUO/nKTmy++IQWm/1aac0n3Z69t+P4FsXKtZXVDvLSu1EhoCNHo6wfg5mVSg1Lg 1JUbR68K7aHo9IAneKg5EEN8cenXn/wWuQcBuwgtEtFqeBkEiUHCXudzvpN/uEQGaxF8 4rtMfsLZq63FS0mKi0ww6telN/WJme8SlD3wNeYVNNF67TsNb7uBnZS2E0aycsZznggg y4Ajq5LUHzqCRVkUXIP97SWnriYZ4AmrDBHhSczC+vECn3lA0XUQm1sIoje2kyWWgCcU Y2CQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=O0vteaX4; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bs1-20020a632801000000b00565f182839asi17024610pgb.28.2023.09.28.01.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:29:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=O0vteaX4; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D2C8A8031135; Thu, 28 Sep 2023 00:53:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231169AbjI1HxP (ORCPT + 99 others); Thu, 28 Sep 2023 03:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbjI1HxO (ORCPT ); Thu, 28 Sep 2023 03:53:14 -0400 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2078.outbound.protection.outlook.com [40.107.241.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 600D9B3 for ; Thu, 28 Sep 2023 00:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MS+oMU4BA1/jrTz6a+k2XAkm2eljsborYcimatXOH4yJxm8KLH7ffjnEcxsCtQSOqtul8SwLz7fC1nLU6GXGXdyKnJscNly+rhD8/aM4kU4f7/mpvyAWv4G6+DlvEXOVLknrk/StP/n8WCabfn1QLkzKda16UwqmvA4n5p45d0zuuO0TPsZ+qQp4fx4196JJKV5fbGTDB0KhkVT02Fx3eYXKsHdUmndOIMkVk3oXGfL1icLc3MxlEmHK4MIBRP/rwqtmXxTRqEkTExYAHiy0cwM3WgpeFOxfaZeTQjxJmWQu4DmikAjgptNOq6mxyApLxrNlZYJgKdYu5NKewGC78g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=AGCq0uZNVAL6cvHEpISFPscV5DqgcKMJIFsRshWOVcw=; b=XYlkcLRnGPUdnPHmRNTjAv+jwl/0wXulebWeQhN9e4kWLfGYKZFypYoF1HabwrzBFQ38x/21nHjbUQW2P7IJyN9NzmAjSrMsXxHEUkfyJ8dIZptWu0Rv6ESl2GoLbxFS4B1FY+e1Khwun0GxPzfpwGZSLzV2HUT2sYyPo/H4J2Kd38pMm/qYbCVnv7UNs7qEudAbIP3obx0wTkl50tYPLgs4Vw5gHWacoSQvLqPlTbJ84GbPGxH/qjqVzXBmHaSCAOrILnWv3GlkPI1xoZ29dDYhb0Hd0qpRABtMWMZZCAZgvV46pkx/n0zvOEuxH5sV3p6hvG56HvSvSTNBdUOoqA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AGCq0uZNVAL6cvHEpISFPscV5DqgcKMJIFsRshWOVcw=; b=O0vteaX47W5wY4uIy98a51XV6T5yCBc7/1rWFIuwZXJpcns5SjPv+wIv3CQgPnPOWzemg3Obeh/iOILwGgCI+tbRsiyMopif21DTw5FdfNjhxi91b5K7OYsMKFyDBWzz+8lkcZr6j1VZ/NXuuhxvBUUwrFVIG89GEQqJw4oQW+Y= 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 AM0PR04MB7027.eurprd04.prod.outlook.com (2603:10a6:208:191::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.25; Thu, 28 Sep 2023 07:53:10 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::7763:779b:1a89:47da]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::7763:779b:1a89:47da%3]) with mapi id 15.20.6813.027; Thu, 28 Sep 2023 07:53:10 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH v2 1/1] Bluetooth: ISO: Fix invalid context error Date: Thu, 28 Sep 2023 10:52:57 +0300 Message-Id: <20230928075257.3123-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230928075257.3123-1-iulia.tanasescu@nxp.com> References: <20230928075257.3123-1-iulia.tanasescu@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1P191CA0005.EURP191.PROD.OUTLOOK.COM (2603:10a6:800:1ba::12) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|AM0PR04MB7027:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a58bf43-bde6-4522-be7f-08dbbff7f587 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YFJI2W/Njsh8vwYWMLzKYMRq+dvW5FWxGG+uvNwIcfZeOxCrb/RfquXV34JFMH/iiDGNzmvHyxAUd9xh2lyU/VNppOhVPbmc9Lv+kUn9b77BRiViAp4Gs+5Du6iLTphe9/eQXWLARYKkG4gbBr2uIe0WrB3H543W7g9QKQLZo6tuK5KGJY4wq+qajUnRoHoXuzvKyTIl6Sjuhq8DJxhir6cJt52DqN7zuyryRD6NOjO/4GPIQJf9QBvcXc0xhrD3R4iLabA9wOeNsByKUyhqrVL8YFJ2qcy+InoMq2LaDZkQG6JjJXVwYDvlp4zio2Gwb71PZT5AIDSmLocWq4imf4CTL8GLOQagt9bS2XWKnHaMakV3tm2nv71TfSUYytSCxxdXgFzqWPYaHf6tdTyeARrotmdUKXDJatkgvs+M8VEeXIEvs/StOxHx7eT6cz9NvEOqngJkKlgtTBY/ac05JXH2cAltjUEH3Kj2EXLHDSI5CTppyi07968VHe/Krucfg5Y5eem/vHcWLnRX3u8x+ETFOxtVvo9YqTeNRZXjCkr0ejdeehgVShAZk7t+X/3B 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:(13230031)(346002)(396003)(376002)(39860400002)(136003)(366004)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(26005)(6512007)(6486002)(6506007)(6666004)(478600001)(83380400001)(2616005)(2906002)(316002)(6916009)(1076003)(66556008)(66476007)(66946007)(8936002)(41300700001)(8676002)(5660300002)(44832011)(4326008)(36756003)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?aVH+GCHIhJSkyVbBXA/jqEOXpB5OsiVST9IjdM5x8uQmo9hqkotR2SL2Fw0S?= =?us-ascii?Q?DXxxE/SUAcmZVhtoMMenWfVQUQqkQv5UYJNiqoMKxyPck8cYBnT6REksZt0w?= =?us-ascii?Q?vZJwKUOuVhTdvxLVYGwOL4pO72p/Tujdl1a/1NbgNA8uTNLcKWm2I6z4vYqr?= =?us-ascii?Q?XnXXnYzUrE8AEHspaaIvHhF8PEFhwPLJCTExJPV/c6pWj3YywLZA+rdPIZtA?= =?us-ascii?Q?7R1IhPO8YvjRpcV5/BJYLDO+Ajd/zJH/rY3jVHZfCb9sYEeX62B7RmCxrqgA?= =?us-ascii?Q?yPoHyiHqdXyIg3XElBcT8gLDA1vb86xk7k7RVOg1z5XS6++c2utlWiTxt14E?= =?us-ascii?Q?NfQQSlspWi4H1EtRSJ5nGo1u8GkmZC1H1O3iiHKVGu/D2JMaeFkqoeNVIvOt?= =?us-ascii?Q?dN727X0GvQU1dWMXrJ4nCl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us-ascii?Q?z/YqwawoYw7y7aJU48VpJ/G/aOdWOSG+cZVC/Ml+I+KhxH5Y2ea6bvP3NOwx?= =?us-ascii?Q?RKN91mgjgrc5LTPWi3031R1RgXcUkequJ1lDG0Z2iE9iqaSXxad2JE8MDrPr?= =?us-ascii?Q?zI6LMjqEn0lO/7qlquoRxMNUccZOqaLU5HD/9DYD8Cps3YIibYN20yr2hNBJ?= =?us-ascii?Q?C5WmPw1wURRoZyAUHQmB7nwZqrP+nm8hgTP6x67yTNZZQfSE3HsJqA/ZEt8Z?= =?us-ascii?Q?6Emi6ZiPZDTE8xbaeMTYiAjUcz83EV2ypsDbxaSJadPHj64TjjAhOmG2kNMa?= =?us-ascii?Q?8A=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a58bf43-bde6-4522-be7f-08dbbff7f587 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 07:53:10.1296 (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: hhl6Sr3DXRh7xgVm1rBk+HAP1MHrgxBjvl0fpYnWTK/bePtDyu04pV+0vw74B4+bGjhTXqKSmrjNmpG6onjnqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7027 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:53:46 -0700 (PDT) This moves the hci_le_terminate_big_sync call from rx_work to cmd_sync_work, to avoid calling sleeping function from an invalid context. Signed-off-by: Iulia Tanasescu --- net/bluetooth/hci_event.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index d242f956dea8..89ba3e5a9c0e 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -7020,6 +7020,14 @@ static void hci_le_cis_req_evt(struct hci_dev *hdev, void *data, hci_dev_unlock(hdev); } +static int hci_iso_term_big_sync(struct hci_dev *hdev, void *data) +{ + u8 handle = PTR_UINT(data); + + return hci_le_terminate_big_sync(hdev, handle, + HCI_ERROR_LOCAL_HOST_TERM); +} + static void hci_le_create_big_complete_evt(struct hci_dev *hdev, void *data, struct sk_buff *skb) { @@ -7064,16 +7072,17 @@ static void hci_le_create_big_complete_evt(struct hci_dev *hdev, void *data, rcu_read_lock(); } + rcu_read_unlock(); + if (!ev->status && !i) /* If no BISes have been connected for the BIG, * terminate. This is in case all bound connections * have been closed before the BIG creation * has completed. */ - hci_le_terminate_big_sync(hdev, ev->handle, - HCI_ERROR_LOCAL_HOST_TERM); + hci_cmd_sync_queue(hdev, hci_iso_term_big_sync, + UINT_PTR(ev->handle), NULL); - rcu_read_unlock(); hci_dev_unlock(hdev); } -- 2.39.2