From patchwork Wed Oct 26 13:15:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 11263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp263304wru; Wed, 26 Oct 2022 06:19:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7QO5+HbeC2Zsbx8FfM4jxef60bb0RtFjO5MseL4Fj3rDlHU4/3HTTNm9edHyDXBd71qaQ0 X-Received: by 2002:a17:907:2c59:b0:78d:8e03:134 with SMTP id hf25-20020a1709072c5900b0078d8e030134mr36740331ejc.310.1666790386083; Wed, 26 Oct 2022 06:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666790386; cv=none; d=google.com; s=arc-20160816; b=kTnd3Ipke80eAQ3dXaKL35XXgEAX76eaiP4WoMT43e+tc+yAKS9GTT2hn11rSPvlvp odU1KkRpuz4VE7uuiSPP7mzDcF9rb0kZ1jRqVFlp0oazM9oV1WPwNFjhXkVwrFTUS8yT G0y3xtaIryoOVfvnjV2In8IR8Vt0tEWE1gnekfCis/bTvkfy0dvL/24iWKDoqeeCgYaV KCNaPn7AyzAgH3erEV2M+DZf91SDu6tGigLJW36iQ0kbomm1KmHOTLVc4JRoAh/8QVSX Ub5qrLW9lZUd90MYmjreI4xOg+iPAaZCv15tHminMdRg8z8JzzJmFbBySCDRYnU4BB4S Shfw== 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=SZraRyM7DZleVZcuBicugzAwWfORdbPbN+RhQtnWZ+c=; b=IMNIfNIzRUb2mldUUQ2cgFuw1TjQlG7JejeNPoQBxwkciOmLyD4IEWcFvepr6gYYWR vHfsp0obMkya1f3VgffBH95cQNTEyiWoSVY4vttQOUqIx0bUW7d471mbALoFE8u1MGjP cTioJW9OC+snalGGsenvwUsGqyC247UriVKwoDlC9i0wZcF4WR9LQVm71VaE1G7KDZi0 I80B0Ed7vy5E990QY3YDfH9bZ9spFRHnbr0xiuSARq74etWCv3M9cgtFfgd8kBk7lBgS OtY2i6GyEHPM6DkDR+LjCi5DAphOcwgQpu5kw4ddbh7Ngv+sugQ57MxjsrGm87ldMUo8 GRQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=Yy6Jurd1; dkim=pass header.i=@tq-group.com header.s=key1 header.b=bxJFbnSH; 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 dn3-20020a17090794c300b0076f061ffab4si6792459ejc.51.2022.10.26.06.19.17; Wed, 26 Oct 2022 06:19:46 -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=Yy6Jurd1; dkim=pass header.i=@tq-group.com header.s=key1 header.b=bxJFbnSH; 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 S234033AbiJZNQm (ORCPT + 99 others); Wed, 26 Oct 2022 09:16:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233619AbiJZNQh (ORCPT ); Wed, 26 Oct 2022 09:16:37 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B27CC87085; Wed, 26 Oct 2022 06:16:35 -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=1666790196; x=1698326196; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SZraRyM7DZleVZcuBicugzAwWfORdbPbN+RhQtnWZ+c=; b=Yy6Jurd1G+5PuVFvg87d3TfPLMvJuQdJkQs0Qc7iZGYioj30LSxiNHx9 f5SyReOTX0J+iYi2hN68qgl7Bx87SSJ0p1tLfaFi/5KWDFVtxLuTCmH0T 502Xm9/xOBX/pjTZu9BZrNI0i+XyOFcS3kRJzfcfFVivANF30rPTg4NTs MUty3laK0vfokZguG174gaJg3rq9iCdnWvKU7ORHZbLKGtorOic13thuu xy7wREcTF6GDlUSbrD71Dt1lwz2VZYn0kIXVPFGJQ3prUg/lpI2hVsYMM mBslZn1740sCAYvrV8XTKA9DpRlqhMdBI+jN0DA+4yqSdKRK084XtbKo3 Q==; X-IronPort-AV: E=Sophos;i="5.95,214,1661810400"; d="scan'208";a="26988471" 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:31 +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:31 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 26 Oct 2022 15:16:31 +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=1666790191; x=1698326191; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SZraRyM7DZleVZcuBicugzAwWfORdbPbN+RhQtnWZ+c=; b=bxJFbnSHUHAVIw6Ud7sc0xIgs2fxUXz60xwsj6VVdyN6zDf6tPCP8NSk baon64StCZvSWTltBrb5UtB3HjXaxSJ2gnHgXOdIaX9JcKzxbj1FBHHrM GyTJBu1B261V/S979rb6438CiTcaIxEltvXiJXz9GFpaCt6irKEUnGnBo QrHEAy0J4VAvlC0oPtDBDY5E37DgtDr8V9/UEUrYzqaWv+Bxsva6EUvp4 8sp1nJqg778KyuJZvJy27N0TySSwpCMZmX4uvrPtRjkfVanqH+pxTv5wZ UWKEnKvyvZQi4FQ921CZbza+eTYiikcH/xcS0cFdqGdH8RWceRYtd3UtX Q==; X-IronPort-AV: E=Sophos;i="5.95,214,1661810400"; d="scan'208";a="26988470" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 26 Oct 2022 15:16:31 +0200 Received: from localhost.localdomain (SCHIFFERM-M2.tq-net.de [10.121.49.14]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id 7212E280056; Wed, 26 Oct 2022 15:16:30 +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 2/5] wireless: mwifiex: signal firmware readiness using notify-device Date: Wed, 26 Oct 2022 15:15:31 +0200 Message-Id: <5d5e1e4b2f4d6c8abc4332f8664f911f26b18878.1666786471.git.matthias.schiffer@ew.tq-group.com> 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?1747756395847653547?= X-GMAIL-MSGID: =?utf-8?q?1747756395847653547?= Signed-off-by: Matthias Schiffer --- drivers/net/wireless/marvell/mwifiex/main.c | 14 ++++++++++++++ drivers/net/wireless/marvell/mwifiex/main.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index da2e6557e684..92176e90b11e 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -5,6 +5,7 @@ * Copyright 2011-2020 NXP */ +#include #include #include "main.h" @@ -661,6 +662,16 @@ static int _mwifiex_fw_dpc(const struct firmware *firmware, void *context) mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1); mwifiex_dbg(adapter, MSG, "driver_version = %s\n", fmt); adapter->is_up = true; + + adapter->notify_dev = notify_device_create(adapter->dev, "firmware-notifier"); + if (IS_ERR(adapter->notify_dev)) { + /* This error is not fatal */ + mwifiex_dbg(adapter, ERROR, + "cannot create firmware notify device: %d\n", + PTR_ERR(adapter->notify_dev)); + adapter->notify_dev = NULL; + } + goto done; err_add_intf: @@ -1482,6 +1493,9 @@ static void mwifiex_uninit_sw(struct mwifiex_adapter *adapter) rtnl_unlock(); } + notify_device_destroy(adapter->notify_dev); + adapter->notify_dev = NULL; + wiphy_unregister(adapter->wiphy); wiphy_free(adapter->wiphy); adapter->wiphy = NULL; diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h index 63f861e6b28a..b28e90db3128 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -870,6 +870,7 @@ struct mwifiex_adapter { int winner; struct device *dev; struct wiphy *wiphy; + struct device *notify_dev; u8 perm_addr[ETH_ALEN]; unsigned long work_flags; u32 fw_release_number;