Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp704045rwi; Wed, 26 Oct 2022 06:19:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5AfqDE7tOBa4mqHlMM7w/p+oK3lGRbSJ7tTMkLtwRS+ejJK0/y6aCXO0PqloKnjh1pHoHn X-Received: by 2002:a17:907:5c2:b0:77e:def7:65d8 with SMTP id wg2-20020a17090705c200b0077edef765d8mr38145580ejb.487.1666790367986; Wed, 26 Oct 2022 06:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666790367; cv=none; d=google.com; s=arc-20160816; b=TaZOhydaG0KTudwHf9N+1kQmJc0SK+In5vkbQd5LzuLbA2VEF3BghVjpLclrivBV7n eKCDcWyGAJZB1wX3BE+orILuoKM+s9eFuRThytOsp2jVKETUxSLAA+7PXcXoVS5apMiQ jCUwZd0V6pkKthQ/h2t1snarCQ+U3b3NjE4Zg4vICe1GdX2YrnuPs2DRVslHwOTafXrv x7q31q9eD8jQ713hgTHAkD95JrEJ+NqNgtGRzlz/hZeQxgAm16XFXwf0el5W1tyW2EMf qwoOUGhUdjkaC6rsdrkJZsKFmuZYuEiTp9oYLJU/Ra72mrQawlZoQMef2g0aWCx5B+Dr /TAQ== 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=IqLYqxiXgYFAIX/UutrUsEM7RWCehKRKaCQF3yL0Gq2g5DetCJ/tsgkQjtipsT6iFn U5jueXBVXPH34Uj4wdTw1ld04GXy1KpXcrPKPMoUKhdEPCT2Zdg1ft82wDBe0mSRFCdt pJsJPvI4zKFUTVHTkbrdK0IgeLMngHvQEs33XC9JHSEy2wdvVBQ7JYWGL4qGz9ESKLem /F10b8Iq+BPV6MSyvDF9QJhRYtciskwFhxTZG9Ha3FTq26hA5Tet51ddj7z4CgBk5O5F TbWENoCmIpSSoeAbg73Xh8p+Ikv/c8+yp7SFs+sCvrpM+hTRijLhf/67aqjV8ENj2uQ7 3KiA== 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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a05640234c100b0045c31d9643bsi4720403edc.2.2022.10.26.06.19.12; Wed, 26 Oct 2022 06:19:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S233715AbiJZNQj (ORCPT + 65 others); Wed, 26 Oct 2022 09:16:39 -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 Content-Transfer-Encoding: 8bit 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-wireless@vger.kernel.org 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; -- 2.25.1