From patchwork Wed Oct 26 13:15:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 11262 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp263296wru; Wed, 26 Oct 2022 06:19:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7g7IJ5DaBOaDMIw4NhTecWSoAW8Ax44eiAQATEiJxk2VflwkDVoEGPlp/mD/4to1pt3nCW X-Received: by 2002:a63:1f0d:0:b0:464:69f8:1cbc with SMTP id f13-20020a631f0d000000b0046469f81cbcmr38195262pgf.574.1666790385048; Wed, 26 Oct 2022 06:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666790385; cv=none; d=google.com; s=arc-20160816; b=XmuWuV9INwiiLN56QITqqeWO+Xhn57MPSay5e257jxhSQDzx6DtL8zrWo4KG5IP6jK mKS0RJnvwJHLUZgem8p2bgqdwyFZtoFm/0IoutJNMA1n7965E3TKJr1DA7fZEkAMM4Wb Fthg1k/zhmxFYBYFFUP+ikhvdUFO0bzaw9zXqiUBrJujN9qCjzFdAFojdB9x9LPV5jb1 WpUxpCjvSGJ8VzXTJzFB/Yio8hNzkIifpHhSqp/no3uTicCTfd1AKFKUaO7TYp+1MU0y TuTqxNuRB7QHwFuctoPWMV0B2xNNI7/tKWWsD0HrfDPAzFAb6xSSIYSX64OHUqrGUWHi c2dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=AQ8LdJdDckBueGG5Er3mqgTunJL51UlKkWeBI9xQaPo=; b=Y5DuuLmk/F6i3PH8Rs43u4PHy6PkjJkfTcjKR7A6cT4WixsILVoMZCi5UHqXr7XXTe VRz9Ui2UHymupc594bAc38a6ugCCGNbQTlZ09+bJg9RG18ccKGQOYqf5TAmoJGfg41dH Ac+GEOWXDIQSeZknptbZykfNBSTJbj3HN1jBccS4PASTcNBoplS9fUM08I0cTEF/DE1b WF+6XTBgWzjYa/XI4sHUl2MAOlmKP+JUjVgw3QHiEQGi9zC1kjYmfLE6zf6wuN/8GSgB 4h8PVvqx2Icg6gNYX4D9yifWS4D6h8yRv76bUDTw7dPoIa3cc53z83xVijPuqCpeEp9W qVSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=HbIMkZp2; dkim=pass header.i=@tq-group.com header.s=key1 header.b=IZJ5D2z0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a17090a438300b0020fadac08a2si2386402pjg.108.2022.10.26.06.19.30; Wed, 26 Oct 2022 06:19:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=HbIMkZp2; dkim=pass header.i=@tq-group.com header.s=key1 header.b=IZJ5D2z0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233635AbiJZNRE (ORCPT + 99 others); Wed, 26 Oct 2022 09:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233773AbiJZNQj (ORCPT ); Wed, 26 Oct 2022 09:16:39 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD51F87085; Wed, 26 Oct 2022 06:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1666790198; x=1698326198; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AQ8LdJdDckBueGG5Er3mqgTunJL51UlKkWeBI9xQaPo=; b=HbIMkZp2KQJcQVlQ0Pn8Rb57+XdijlvGGZBVFdyJIqaUR2jA7CI7w5Zi PPoF44RIe1qYK5IVNT/jF3HfLXVNpPFjQF2x7cvTtjCuqiux25O0IpQDQ sHkBkoNxGsJhpTJUADbNTf4Mh5f5v/jOnHgIT4WVT/2BsQT8ahwyuOeSc 7Q1xLCyg/1vnDuD6AvFfn8J+sk/7WOzP4i0wvhEGGaMlQcd/OrVmMerXG aTASRtuOQwUMSIzQnAK0AfWHBNBjO863jgxs8wObYFdKD7yPfqbHjByQJ M/J3aohSCQVaSRf46pJl/FSE5xqt5JFlifct/1D8KSlXm/2YMxnMsSuCv A==; X-IronPort-AV: E=Sophos;i="5.95,214,1661810400"; d="scan'208";a="26988477" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 26 Oct 2022 15:16:32 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 26 Oct 2022 15:16:32 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 26 Oct 2022 15:16:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1666790193; x=1698326193; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AQ8LdJdDckBueGG5Er3mqgTunJL51UlKkWeBI9xQaPo=; b=IZJ5D2z0IFL2KfFH0KlWWd6DscaAybMlc+Xfp/WLHFG06VCHJWaGD0f9 N/E+eXFVu8JdwIVL+e10Zgc1DqIO4gyJG058StZpr+KPW+wy+R7/K7C3y 3IxHQVJo9eDn6IoWveWT1XpGtqVtzmKBSL8S3a4iXYD/nC9fkCh7QZPDP gqsBFKtgfFC++Jdw4Ga0fBan0UxpDmtMKJKywfsbdQlF+LLLW0oQh8yrH ah4Ot4sq9viLDrpE+UkF1Xs8eX/ZXIPsf+1TCe9THdlZ/3Rd5HWYJdSlh WNYtKOPNgz7DNXOORhThSPVsJDM8Ys4s/IwQrnAF0TxHbxOPHgaRu8P4X Q==; X-IronPort-AV: E=Sophos;i="5.95,214,1661810400"; d="scan'208";a="26988476" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 26 Oct 2022 15:16:32 +0200 Received: from localhost.localdomain (SCHIFFERM-M2.tq-net.de [10.121.49.14]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id 78F70280072; Wed, 26 Oct 2022 15:16:31 +0200 (CEST) From: Matthias Schiffer To: Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski Cc: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [RFC 5/5] bluetooth: hci_mrvl: allow waiting for firmware load using notify-device Date: Wed, 26 Oct 2022 15:15:34 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747756394711078826?= X-GMAIL-MSGID: =?utf-8?q?1747756394711078826?= Signed-off-by: Matthias Schiffer --- drivers/bluetooth/hci_mrvl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/bluetooth/hci_mrvl.c b/drivers/bluetooth/hci_mrvl.c index b7d764e6010f..dc55053574a9 100644 --- a/drivers/bluetooth/hci_mrvl.c +++ b/drivers/bluetooth/hci_mrvl.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -433,9 +434,25 @@ static int mrvl_serdev_probe(struct serdev_device *serdev) return -ENOMEM; if (IS_ENABLED(CONFIG_OF)) { + struct device_node *firmware_ready_node; + struct device *firmware_ready; + mrvldev->info = of_device_get_match_data(&serdev->dev); if (!mrvldev->info) return -ENODEV; + + firmware_ready_node = of_parse_phandle(serdev->dev.of_node, + "firmware-ready", 0); + if (firmware_ready_node) { + firmware_ready = + notify_device_find_by_of_node(firmware_ready_node); + if (!firmware_ready) + return -EPROBE_DEFER; + if (IS_ERR(firmware_ready)) + return PTR_ERR(firmware_ready); + put_device(firmware_ready); + } + } mrvldev->hu.serdev = serdev;