From patchwork Fri Apr 22 16:02:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: icenowy@outlook.com X-Patchwork-Id: 565776 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96539C433EF for ; Fri, 22 Apr 2022 16:03:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354454AbiDVQGF (ORCPT ); Fri, 22 Apr 2022 12:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232289AbiDVQFz (ORCPT ); Fri, 22 Apr 2022 12:05:55 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12olkn2092.outbound.protection.outlook.com [40.92.21.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A45255E149; Fri, 22 Apr 2022 09:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JAopLuNi5ko5M29QRawPZImyb9K1aDn7CugSvUcvlDNDwysHZEuWV5JfqLs6xkKNkUHWZ32Qt6WXwC2yoF39MlbMARGbHvwZz18QsYYKhZdEIHNRVad6fPoArvSwDf29Ze2xFSSBIjfxrrWYhEk66cXOCETT51qs2OW4RELGmDY/WkMJLXIGqchKEOfrehkxANTBdeo8arm00SDiC86Aztj/Ej3tkWWGzlK/3gaNZfPvlqILj3TNKadT1xeNpHVWlqJbY82v/XbRQAIkpbz+VZ7704gstjxXbZP3QOMm+XU97PV20gLbVGT9uySsLxwAFq2Ea/hFd0o3wP5+IP14ag== 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=b3bO13YmCabNvWf6OwNKP2sas0CpiP6jg/J18b8Pz0U=; b=IZAc3wOOIOgXwjr5oXuZ+RVOiEi51AcvQKJCBoL6dTDSEbHd27kbJ9o9mCy6X0Kx2lc/vNPegfUUoA98VqhTFJlDC5CcFJaciz2BX0JbQsizLrzoDrRDAwNRGwQowGhsIGInVsM1p4d1cOx+gKFMhghfLuiSJcmwcvG7bcZIpj9NMHmuRmL1uAuH5nDUA4kTbBhjk3XW31Rn9ZRkYfvMVUvi13nrrb9CzTnKdpTyZFXXKUJCcd8d+ctPhm39dZsMyEeb0lsHQqN30amwwFVtcGjHT3kO/nEkN+IKdDsup3YgZ7AxMftlBJ/SkOnDdq3kzJMlCVd2vM4jXAagc55hag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b3bO13YmCabNvWf6OwNKP2sas0CpiP6jg/J18b8Pz0U=; b=mxm9Dk3Iy+mMp12lLYYfeKSYjAL/lhFRIllvOWMUrrFB5JUfLN3M4nDsAMshRxRkmR6FAF45U7nD1UmTiYhAfghiNP8X6b+iHoPpNFEHk7lFLtD+dDjBknuGB9raOVK9h5c7rV92nEfGtBWWYRHcktWiyn9AfGorliOQwc//ECiBHRt+V9m27eCC7HNBTY3f5fY61KInkqKxtgPouVDi5Cnbyd2MiEtI6q2AnT4LcqWBn3Q0FvrreKNH/3qC/IPdLT7FKRRbvvq7dHfMNfX2vMHYrCTvGvFBDu5YC75mH2ZGEVj7eAQDoIBIGrI/nLx8S9JI40n2n8eiqTdnSFKBbQ== Received: from BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) by CY4PR2001MB1685.namprd20.prod.outlook.com (2603:10b6:910:68::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Fri, 22 Apr 2022 16:02:58 +0000 Received: from BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3]) by BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3%6]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 16:02:58 +0000 From: icenowy@outlook.com To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Icenowy Zheng Subject: [PATCH 1/3] Bluetooth: btrtl: try config w/o postfix if postfixed one failed to load Date: Sat, 23 Apr 2022 00:02:29 +0800 Message-ID: X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220422160231.1072810-1-icenowy@outlook.com> References: <20220422160231.1072810-1-icenowy@outlook.com> X-TMN: [GLyOAnXyVB6IjTCN6k0tBy6bpZ0TJQdv] X-ClientProxiedBy: HK2PR04CA0070.apcprd04.prod.outlook.com (2603:1096:202:15::14) To BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) X-Microsoft-Original-Message-ID: <20220422160231.1072810-2-icenowy@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 933fa029-322c-49fc-5382-08da24799129 X-MS-TrafficTypeDiagnostic: CY4PR2001MB1685:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XPvqHwjKGA4AVqI353HHT/lq84Zlm4/36LVYg7cpEwE4I18G2RyDIhQt0+DBAfBtLa2nidbu6Qmi6JZEZpSuMRCQkKTe3whOwV9DQd0DAelCWcB5UFYEwJvs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DnjtZFOgr576+hwttoC9cvGsJUDJRToPzcgtFnNQqnjbttO2i0kL7tQeQDUK4nO5X1v3v9uIBHc1QDcWz+wGZ9zq15ONJo6J/i1gJz8PQ2D9E8h1ApvhZzNX5mgGqUIjEPlp+QmzlDLAqzwJrgCE4VWLHFaMOMMslizouGh8WaPbrd5eWPcRuC1ZnEYxV6I1U/Nvq7iMgRNww30fmqACxGqdGuk3X5E3+fn2HixIEiUcFs3mmqGo41dhD5dMyhU0I3dheDoNh03qXp25bgAZjFh3Xv3ulKhQ1ZpPmPr34BnfbbjKquxPzZE6MKhr4mSosUPV7zsiCQAvO36Su9uammSFYJGwAlOU6lDkUoIc9ST538USo0IowSRLo73ct/fuMiE8KZTYyNL+1Uarzhs/q2nq2bvfAWQG6KsTvQUH6pon4BywLE+JCwQqA5yjeReEwaXFclarU2J7pNmaCkDZqgb3Bb/PMAMPEFfSTTWHayChdmduBAoGCX/ql8RBs/vum12gz5BqbPTtpUi7fbQBKoQ33A1nTklHWU7R7jb52gHe21u9AtCc7iA9yeUAEvq0epHhrifUSemmIdd+zjONN2EH7FoKMOdUyn3ICY6EvG8m+LMopQAA5AKmmJ514dspi8oEt/ySVtSjhndnZoDhsxEQOQFd3Qq8VcvKZr0qZZuFc4maj7MUgsn4TMBbZ6L1aR9kneYlEUU8Fv67iDKeH+rdnG/MAjURPspnEqfdx2lsBOFxHtYGmpMEg5PJ49Ryk/QMt5mU3GOFH7DVpD18N6AkEpPWSYZqL52mFMU56s+MO773iujPnf5GhIMIdcqniu0+TK0UaB7Cw6witVyRypFQg2T51u4UGIJuXUbrobq5ibJgai/CS7GDwofixeTJ4hskn8E7dGJnmjy34= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 933fa029-322c-49fc-5382-08da24799129 X-MS-Exchange-CrossTenant-AuthSource: BYAPR20MB2472.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 16:02:57.9830 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR2001MB1685 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Icenowy Zheng We should try the non-prefixed config file name if the prefixed one failed to load (possibly because of it does not exist). Add this behavior to firmware-loading routine. Signed-off-by: Icenowy Zheng --- drivers/bluetooth/btrtl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index 481d488bca0f..1f834513762b 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -699,6 +699,12 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, } btrtl_dev->cfg_len = rtl_load_file(hdev, cfg_name, &btrtl_dev->cfg_data); + if (postfix && btrtl_dev->cfg_len <= 0) { + snprintf(cfg_name, sizeof(cfg_name), "%s.bin", + btrtl_dev->ic_info->cfg_name); + btrtl_dev->cfg_len = rtl_load_file(hdev, cfg_name, + &btrtl_dev->cfg_data); + } if (btrtl_dev->ic_info->config_needed && btrtl_dev->cfg_len <= 0) { rtl_dev_err(hdev, "mandatory config file %s not found", From patchwork Fri Apr 22 16:02:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: icenowy@outlook.com X-Patchwork-Id: 565029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CC4EC433EF for ; Fri, 22 Apr 2022 16:03:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348447AbiDVQGD (ORCPT ); Fri, 22 Apr 2022 12:06:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376307AbiDVQGB (ORCPT ); Fri, 22 Apr 2022 12:06:01 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12olkn2031.outbound.protection.outlook.com [40.92.21.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10BD5E157; Fri, 22 Apr 2022 09:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gXEfS3YzJHlPKKvo1soZeLQjCAqMPAeTQyQ1w/uqmXBi86Q41rVwexyxlw57RZINriVokLCn7eF8PMfZOeRm2ovJjfeNtHQ6UNxM8Y7d6BhTO52KTFw7uJ0ueuPEHg1JflNC+yfLtcBO2rojiZqDdpBTbwtxQxJNpVo9R6gPAEjHXf5Ne1PB0yzvdtXvysWnWA3cYQ3mRYi9J+xkhKwr2HixdjZEKsGK+rZ5QISA2K0RvQ6uixbBfXr7TfVNegmtIFfUE/jNQI+pKMgCIdPSkTV1v+S/MN50IFkOFRKjIei08WDzNqohKaV1n4GWeMnnp+Eo5O45vwLgc2nL98NPkw== 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=HBiWX7yEUfEk7mpXtQQGrm6vN3vRvCXaaarN+9t3hrc=; b=YVeyh16IGSjpy6mjcVpSG7Z08ezrMylszwHrtNxlba8DvN58m5pVJAeTJZHVaEamPrrhSQeL0TKoqhCYXDm+Xr9EQC/D7zJhV3Nvqia/dnQgyLuo61z3ozsuheQWZQGDTFghB5o/RzV2J7gxWXjjE9sKZrQgWKzZxqiGewIu9785Ql2BCGiBpHeltop6iguB0iyI7pylfjy9NJJuD/pDDcsj1+fRxkgFgqy1/8uFc57ND4w/SBxI2XNC4QwXS85jb/mopEpivG/xKNarqaEuVLFje+b3pQSO1YKdg9exLi3TClK9KhgJ1sD8CaMcvCmoOa9SLv5hclluvBtzvKb/Vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HBiWX7yEUfEk7mpXtQQGrm6vN3vRvCXaaarN+9t3hrc=; b=FnJPc5OBzPHNMShuXOAbHjEahU4d/O3SwmWbkuRzkgLw2e+lKA0mooPaN3/w90i+Am0ui03gamueR3CwSMlvqcKZPvY7hDGyAiz7/kRz3nVcYaYTk1UvFP58tx56iHQgQbLE93RutOtynO5iBkpDx6D0+G1dg42X7YiQzuHnWJWJs6O0tbzlIKkqncjWluGVJLBQGvlOmWBhdSEnxO6GCZ9UhJHLVVxqdhM6K6uTTvGx9EsOu8mXrrV5mW+nzLqrlY0Q5xleR+CPqN2u4bdD6+64GLRE1jGcnzadS40Kr/yfSC+6ZFraU8f4Ff9/E+urUg24zGAdfD07LIA3jRXDGQ== Received: from BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) by CY4PR2001MB1685.namprd20.prod.outlook.com (2603:10b6:910:68::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Fri, 22 Apr 2022 16:03:04 +0000 Received: from BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3]) by BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3%6]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 16:03:04 +0000 From: icenowy@outlook.com To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Icenowy Zheng Subject: [PATCH 2/3] Bluetooth: btrtl: use board DT compatible string as config postfix Date: Sat, 23 Apr 2022 00:02:30 +0800 Message-ID: X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220422160231.1072810-1-icenowy@outlook.com> References: <20220422160231.1072810-1-icenowy@outlook.com> X-TMN: [J9oeLPeTfYsRuFZxyCX9oQJldRlnxkhq] X-ClientProxiedBy: HK2PR04CA0070.apcprd04.prod.outlook.com (2603:1096:202:15::14) To BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) X-Microsoft-Original-Message-ID: <20220422160231.1072810-3-icenowy@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e54a173-6c65-4a66-dabb-08da247994ee X-MS-TrafficTypeDiagnostic: CY4PR2001MB1685:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IlVPdg8toQQFsGTLZRlSh7bGTDqWVrY23i4OGekRPavASQjiQ0UxNM4xSPn3nZweYfXNOvO62s45nSo6eeUJiFuGgT0QMKwMcE0MikfhJweJDkKZJVZAJhzWFPzvDXUe+2i4bwvZ3yqwRhDifT6Bk584utXBnYjQ8Yd3uwCpLnTWvSsOCDCcYELDbvSwEINQ//WDxmp0LTiP4wsBlKBxYxgxcT5T+OXB/QN3jHUr1x2uU4BA1zHo9ftMmBZAzF1fdmkGzxw81vMlDVfr8o3qXVERihr+fXUvcFxDcrUrdHnvfKzLsde0Gw6bNQslPT4XRVHssuNp7DRUef21mLdiSXv904ZnWX0mBjDJmmyFq6uAH3S4fn0t9MGXuoejXxX2drBImslPlFuoXqGpCReg1vhbk7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yFeHmlfOTDVJIKO4uZ0JIaKDGTdiQAvODvXe2Y2wPBPf6qZr77pT3PhtCOxFNhsRN3LTWdZ8YQY/KznV1UxoTPHlavrnZ6zPW8/bZUHkoi2bB2PJ5zeS/m31BxIDt6exxa9aUJ8pLhUUrX6C9K5hHZxLRUm6R1UfOiJradR2z89upFNL7L8bNr8/iwS5vBkFogYlPv4gyipbDAaE7oANi37Ycx2Az7w6aUKZCGB2VTs9PbXa3Qub2m8AyAEatGxclTn5cZDNqrch5T1IYJTCsVLI3h36wQwzOlTS9qbS8RvhYl1VLB4tRuz68pcnJ6vKudY7mGd60EBWR32GAk78AcmMacR9CLigLVWj4miHVk5z7kz+lti7HdVdEZ2oyMvkVAwqLE0nJOGxDbqYI/zNKyjoQB8jvbbeYZB/nnYUO75Yreeq23o/Cpob2qFNQ2+RaHJIYvGXJkFyFNxikISeXyd68KeDnIa6g4Gghh0nQ0cHNjISBviFjghdL4CZ5Pg4ecGbJ/qFh0VztHQesw/BnCSdSTXDQT602H5TE3J5ITOmBX1b/wJNJRhsC86QIo/Ena02sXn1kXfTRQxOfQ+Q6Rcjhy9XaSFHvJmZdJWY= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e54a173-6c65-4a66-dabb-08da247994ee X-MS-Exchange-CrossTenant-AuthSource: BYAPR20MB2472.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 16:03:03.9982 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR2001MB1685 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Icenowy Zheng Mimic the behavior of brcmfmac driver, which uses the DT compatible string of the board as the NVRAM postfix. Signed-off-by: Icenowy Zheng --- drivers/bluetooth/hci_h5.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index c5a0409ef84f..d1f90b23a5e0 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -817,6 +817,7 @@ static int h5_serdev_probe(struct serdev_device *serdev) { struct device *dev = &serdev->dev; struct h5 *h5; + struct device_node *root; const struct h5_device_data *data; h5 = devm_kzalloc(dev, sizeof(*h5), GFP_KERNEL); @@ -847,6 +848,32 @@ static int h5_serdev_probe(struct serdev_device *serdev) return -ENODEV; h5->vnd = data->vnd; + + /* Set id to the first string of the machine compatible prop */ + root = of_find_node_by_path("/"); + if (root) { + int i, len; + char *id; + const char *tmp; + + of_property_read_string_index(root, "compatible", 0, + &tmp); + + /* + * get rid of '/' in the compatible string to be able + * to find the FW + */ + len = strlen(tmp) + 1; + id = devm_kzalloc(dev, len, GFP_KERNEL); + strscpy(id, tmp, len); + for (i = 0; i < id[i]; i++) { + if (id[i] == '/') + id[i] = '-'; + } + h5->id = id; + + of_node_put(root); + } } if (data->driver_info & H5_INFO_WAKEUP_DISABLE) From patchwork Fri Apr 22 16:02:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: icenowy@outlook.com X-Patchwork-Id: 565028 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53DDCC433F5 for ; Fri, 22 Apr 2022 16:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358249AbiDVQGO (ORCPT ); Fri, 22 Apr 2022 12:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239021AbiDVQGI (ORCPT ); Fri, 22 Apr 2022 12:06:08 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08olkn2031.outbound.protection.outlook.com [40.92.45.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 706215E14E; Fri, 22 Apr 2022 09:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q6zEpgCm1ylcPqpac2EJIzgli5fKI7x7ml+Mab/9r/NdhJ1LzXg2Wr4DyGfHkM9M3JbDRbwO/G9pSnYjENQpsAFiJqmUxmvgVP4w0X7qkX99dw9Ya0dQZjZSnVaZBGZWmyvc6ioAfetJvGY8yO/KRIxAZKpkIXaMvwHTe5DwFM71tIkWldDPUe/LlESSk5pCHec9OcWnlrcGyBHGbJj0/o5kCM9VzpAy/74VnrQ9bDiKXkZRA+ZYpLZNZ84rJpVXKgJqE2z9aMV06n3CgVlesxyYVj3loA8xaGQdsdH/mKyVdVJloJDXmln/rRncYxuwtEi9uyPLNPlix6lX6t8q8A== 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=1dmRmvkTqQATY1SddI7aH8HC55MQHwYxtVFfi+Ezz6w=; b=GNxXECybP0X8nzcoUoE2fWMZg/1Uhm0YK3oAxL50JOPwI5Eka8XwB4rh6spXMLaM5rFBoaKTjZkxseKvFFzz0oNJ8aMRSDZl6VOKfla7sYWHh6IMyVBENsZFttI+1kynCx4U9RtAQ5Kwr4txi5H/YCmvjLPqNLTSj4FoE96cZQa20PP9c/IoFXWoseCqxABgz5t7KAjuO/z7pQDaksMjRcanW6r0vC+tD4X0yrxl6igKyW24mI7xXk9V/wSa7xkNw05fAivbqfdj7qyUu39/uvR4W7asN9id3/nA3ncNxs7Ui0AJhOOkjTWPVlO5LkqtMPX4HpZSvx+0qseO0ZLcFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1dmRmvkTqQATY1SddI7aH8HC55MQHwYxtVFfi+Ezz6w=; b=nCkHETPswnFbql+xCBMfHTH+g0JeuLCr/9KNsR8VatLoTogqFcScPIFRqpP9NTehsFkVE3GWTgCWfN5PaXnL9ot/0+GrmFeVWs3D8ty8FovB/2w7AgcXx3ERHC9ykZ/8Piu5Y7xigMiuf64N4mSCqpTyIoPoX/xuof6odzxT7unR/8L/XZ3cr/dsfIL91AlhHeOiNr3xyKx+oOca35KqAAY1zK9lDoeSEs9I8F46rQFEf/oagST6YdH9jD3xYmlyNOHkdh5aHOidX1wuFGc4xuhqCOevcH+KioImJUZo9yqLJSqDPdr4f06OSLLhG0DwmuSfxbhl08FwZQXwkHzpAA== Received: from BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) by MN2PR20MB3277.namprd20.prod.outlook.com (2603:10b6:208:1bd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Fri, 22 Apr 2022 16:03:12 +0000 Received: from BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3]) by BYAPR20MB2472.namprd20.prod.outlook.com ([fe80::3480:160a:eb92:d6e3%6]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 16:03:12 +0000 From: icenowy@outlook.com To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Icenowy Zheng Subject: [PATCH 3/3] Bluetooth: btrtl: allow longer config file name Date: Sat, 23 Apr 2022 00:02:31 +0800 Message-ID: X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220422160231.1072810-1-icenowy@outlook.com> References: <20220422160231.1072810-1-icenowy@outlook.com> X-TMN: [dDZm3PGpGqlaiGeCqj+byiPjhnA0yuy6] X-ClientProxiedBy: HK2PR04CA0070.apcprd04.prod.outlook.com (2603:1096:202:15::14) To BYAPR20MB2472.namprd20.prod.outlook.com (2603:10b6:a03:155::16) X-Microsoft-Original-Message-ID: <20220422160231.1072810-4-icenowy@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0923ec21-1c3c-4d3b-d968-08da247999d4 X-MS-TrafficTypeDiagnostic: MN2PR20MB3277:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lXo+I+LO3xCfU5SG29ZbYsm2xr9B8pcQoL6YvOvWZjhX5kUoHpUGP1a5sF/QMrdG0A0bAYtX98jNrY9S5N+xhLcJ3MacQxNsPN5sV/3DUq86J+OO7qYTGPV6lI737kcZ8TDyUsRdXa4WCGmR2gqtnrXgT1aasiwfiWzrgR1O/fjIm4RcqhyiOk8jEPqpHLMsKZDc04OX/Lo8/aUkmx0y7fKtd6iTQGxz4ijQbg7UIDHp+5EJmWjMRpOAgNxCjZsinJVEn6E4G0iNDkID+FN0adOHfi6Y72kehw4TAqEXOYoqMIH9pB6GNtU35/muszPpHOyOOOy0IzNLE2TZ3AIkHQsBhUO58YX0oYhLBCpzZUAJHh/zW9H/dk9vBOHMsCFKkgLIHr4nDgUqP6WNCGdw7Tx7+uYArZUj7TbHLs1ahCxQNsstGXm9Rzs/jt/OM5BCXXo+jwsfCymY2CJOLA6X9Y2ij40eQEOWsDRGwEL+44uq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ka4BjdLMFBmhXhl6jUyajr1YBSfVXNR4mVo4nEPRQtsSoDefByg+cRyStYEXMPVeZkm7vP/AwWJGCeiv6IzEKyoJ9Udv8+oMzqtLVrxVJ8jdYk9L1xOhoAZYHB4/WyQMiGZF+B/3ICtZTn+hrpORnior9mW8pLSvgLm1xxy8QhXclQFwbhaqz1551SpIt9kevmWKwaRaTdkGa0lX9lsX+k2JLCfRuDYZ4Xa0n5KQJ8I408ME5vR6e/weZk83Ao4PfC3zSRdvaRo4WxL1yDnE2NmbswJ+mporihhoT2pMENxBgfMiAm7mcja+TA3Ufgg66KgOGNAFyDwHyImMaldgd2C+0bNmOLqkJvsRKh8Utr+Q6Pdz7s1PMCrvW+/mz7Du7CWsDvhBqcciq2XowWNbVSFhKXZpN8HT8R4qrVVFvJY6P2heg6xaWt+LFHVqMx3tU73t8h2qgO+oBSN0yIND22S1GJITjVfa/3ffHMgW0c5GIpEBTjgkIZ5Z6rEGSqDihxeriGqW8lp8m/5B8fxB1EbXlbE= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0923ec21-1c3c-4d3b-d968-08da247999d4 X-MS-Exchange-CrossTenant-AuthSource: BYAPR20MB2472.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 16:03:12.1852 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR20MB3277 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Icenowy Zheng As we now use board compatible as postfix on DT platform, we're going to have long postfix strings. Allow a longer config file name then. The value 320 is taken from brcmfmac driver, which has a similar behavior. Signed-off-by: Icenowy Zheng --- drivers/bluetooth/btrtl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index 1f834513762b..383428977a7a 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -591,7 +591,7 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev; struct sk_buff *skb; struct hci_rp_read_local_version *resp; - char cfg_name[40]; + char cfg_name[320]; u16 hci_rev, lmp_subver; u8 hci_ver; int ret;