Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp493655lqb; Wed, 17 Apr 2024 02:34:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrB/pxRhTZhuLHH4/CvTHg+ZPfr2hEIoEz+4Vg4eciVYTH99LSPfmVCrUjGsBbCD64e7NxwMR2dhAq+MQSgh506/ZZPDEulJKstYU6KA== X-Google-Smtp-Source: AGHT+IGKiaaimNi3xdDGdxvY9fLZr0wCgTuLj46e28pEeg6+kOkzAMkhYqZams6LPsWFy8tzvhU4 X-Received: by 2002:a05:6871:8795:b0:22a:dc7:7d64 with SMTP id td21-20020a056871879500b0022a0dc77d64mr18887132oab.10.1713346496744; Wed, 17 Apr 2024 02:34:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713346496; cv=pass; d=google.com; s=arc-20160816; b=GjkGpxPGuH6EVPVEM3j2Ak9Mjln8L7zI9IIYf5zJRjRkLdTx/n9D1EszWuNNGM/MuI jXKhL8yJRYRUUbCy5i4BSl9rpSlAyoij3oqopT049042jQop29hkJflamLMdgWu70dI/ /dnZIUgvzQ0Z01Cs3rTJ4LvhERDhONW59c6Pms7Bb/hXhWNjpDE7LFstEeogXx4KyhNk lIrY+okvJubqj/RGDacPK7hDxvzqIz7NPaJHws1GUVzEPjI79fnuRbyk3XxC5QTVU/FN rRQldi2tHRSirO5KIFqmZKjJdzHHrjgBSXCafFv+pPCeMfPCmCrZGKVAoMM0aHn+XFLN bnFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=g9mywsyvFR+b2b90l5RvO1Xzk1fJrXNUaUXrvGwRgyw=; fh=rjH/m17IkK0qHNANy22rBnBp+6rHl9oZwPI9SfTTltk=; b=zk+57otqGMa7hAAEZUGug9Wr9kyjqmks+HkIoVP6FY5TT+YFUmG4VaJAZ31k1dtlUq fz6Pav+XmyPK+Q+kpA6J28CkAYURV6vzp0pIn+N2on+TL74wLgoqAJVdlmIYpAdKo00J 4bMuVIZdtdp3lW2qZFgJ8FAXOWtAntE9CgVe3lkmt+jyBowsbUxf2Hqj+MeA8Wdqu5FE hFu9o+ek0vwyEs8q4dJxXfKQ5meqonwVMoX0lewjvVgNyB5kiHb9hOX/qy/LLw5at8KL +j3jSVC3XSae/6tCRZ9XaeNgqHqghrLnch5x7sXF+xbWRBEyCEXy5IPldzugsxe6pVzL 4bKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WfOmZAiP; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-wireless+bounces-6433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6433-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bm20-20020a656e94000000b005cf60fc5fc9si11572204pgb.274.2024.04.17.02.34.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 02:34:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WfOmZAiP; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-wireless+bounces-6433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6433-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8A0AD283EB3 for ; Wed, 17 Apr 2024 09:34:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A25B712F375; Wed, 17 Apr 2024 09:34:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="WfOmZAiP" X-Original-To: linux-wireless@vger.kernel.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68A4513AA2E; Wed, 17 Apr 2024 09:34:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713346463; cv=none; b=UYDtpxTmFMlIPAOYJLL3/p29G3MLq1BJdTdXMWtnbKogsEy0IoSTMVi1aYlZz55iWk7UnL/2a3gFDdtA/AFGIq/GBdpMA/y2VaCZMkd9PlU0HkrTVY/BHeuJ8eVvt0jIgKkNe+4uBJYmKCmLk5wpx2+BRdjGhMJKwGA6xGla9Uw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713346463; c=relaxed/simple; bh=IA6NeFKMpm8UaFyMn2FIPCKOpK3ratJvAaNDp/C02dw=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=D7XeiSfs5B/kcAJK0WzQvX0uNtBK2+rn8IYw5w5lwpoBkApWirA1VA3OJsMt6Jwuj9h/yMg0Q3NlVOGRCv8I09+nnxWAwHMT5nohLOs4B75FLStYpfA91HrzbEClIfY3d/wzKx8CcBQhy0swfnudUOCTbaAIRvBiiVGAa1hViXg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=WfOmZAiP; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id C978BFF805; Wed, 17 Apr 2024 09:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713346454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g9mywsyvFR+b2b90l5RvO1Xzk1fJrXNUaUXrvGwRgyw=; b=WfOmZAiPZ7GcKuFhHLznzEDA8WJs5xUY6URYtJzb0IJIpMl4rA6slSAxNpfR1L53nOaEYh N9OC/6NmzFaANx3FAMDYw1kRpUIQ7DH4HEuftSXwruN3B/C2WpBeC/d38w5HnQeioqOdRC Uq36FPA2lwb85cQ89uuA+PSXm3h8eS5ouaOGso9LyZkpBJe/2OE5kzv1M3LfzxT+ob/Y0C McQpFBv53ooQLQ+NcYMtf/EdKSU5XiTMBEgMgfwW6m+a5D8XaIxKoV8L+MH08mU3sgLbEe 7+xiNZLLvUOXOlxX4KSiXDYmdVCdHgtYuv1u44X6hMbP8BJyQUccrxDxdyhvWw== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Subject: [PATCH 0/6] wifi: wilc1000: fix default mac address Date: Wed, 17 Apr 2024 11:34:07 +0200 Message-Id: <20240417-mac_addr_at_probe-v1-0-67d6c9b3bc2b@bootlin.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAI+XH2YC/x3MSQqAMAxA0atI1hZsHBZeRaR0iJqFVVIRoXh3i 8u3+D9DImFKMFYZhG5OfMQCXVfgNxtXUhyKARtsNaJWu/XGhiDGXuaUw5FqvRuarnPY6wClO4U Wfv7nNL/vB+d/HQtjAAAA To: Ajay Singh , Claudiu Beznea , Kalle Valo Cc: Thomas Petazzoni , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9?= , Heiko Thiery X-Mailer: b4 0.13.0 X-GND-Sasl: alexis.lothore@bootlin.com This series aims to fix invalid mac address issue raised by Thiery Heiko ([1]). WILC1000 mac address is currently not set until device is opened, at which point firmware is loaded and started. This results in default mac address being 00:00:00:00:00:00. This series, based on an initial patch from Ajay, reads the MAC address from chip eFuse whenever we set the first interface (at probe time). To do so, we need to ensure that any bus communication is properly initialized, so the first commits slightly rearrange/fix initialization/registration order to allow to read MAC address properly. Based on the tests I did during this series adjustments, there are still a few corner cased not properly handled, especially when dealing with two interfaces on top of the same wphy, but it fixes at least the user-facing mac address for those interfaces so user space network managers are not confused anymore. [1] https://lore.kernel.org/netdev/CAEyMn7aV-B4OEhHR4Ad0LM3sKCz1-nDqSb9uZNmRWR-hMZ=z+A@mail.gmail.com/ --- Ajay Singh (1): wifi: wilc1000: read MAC address from fuse at probe Alexis Lothoré (5): wifi: wilc1000: set net device registration as last step during interface creation wifi: wilc1000: register net device only after bus being fully initialized wifi: wilc1000: set wilc_set_mac_address parameter as const wifi: wilc1000: add function to read mac address from eFuse wifi: wilc1000: make sdio deinit function really deinit the sdio card drivers/net/wireless/microchip/wilc1000/cfg80211.c | 10 --- drivers/net/wireless/microchip/wilc1000/fw.h | 13 ++++ drivers/net/wireless/microchip/wilc1000/hif.c | 4 +- drivers/net/wireless/microchip/wilc1000/hif.h | 2 +- drivers/net/wireless/microchip/wilc1000/netdev.c | 71 ++++++++++++---------- drivers/net/wireless/microchip/wilc1000/netdev.h | 2 + drivers/net/wireless/microchip/wilc1000/sdio.c | 71 +++++++++++++++++++++- drivers/net/wireless/microchip/wilc1000/spi.c | 17 +++++- drivers/net/wireless/microchip/wilc1000/wlan.c | 48 +++++++++++++++ drivers/net/wireless/microchip/wilc1000/wlan.h | 1 + 10 files changed, 191 insertions(+), 48 deletions(-) --- base-commit: db5037bd459adeba309af1f97fd5c9b6a0788b2a change-id: 20231221-mac_addr_at_probe-3cb6044b251d Best regards, -- Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com