Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp88863rdh; Tue, 6 Feb 2024 21:00:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEir9Hn6hhlRvD1n2ySiSY5HEuz8Kxmv3QK6c/aUhvWgbVaA3w1X0wynqPdSjtdj4t5moVs X-Received: by 2002:a05:6a21:398a:b0:19c:71bc:ec82 with SMTP id ad10-20020a056a21398a00b0019c71bcec82mr4251045pzc.48.1707282021678; Tue, 06 Feb 2024 21:00:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707282021; cv=pass; d=google.com; s=arc-20160816; b=jW+YKsN9qckZEY8Tmn3WMAIC/+BTddoPjLIZqROVxZIU6pL2xXbW3xJHjnTNFVG6gv iEwZ2lK2qslXOR5tEiM6n3B0E94Cmqahop7UmcYanowTQ4cKTzfODiZnOLncdYe7644b 8wc00MVo6vnvXyfHWJPSK0Ukd3Hp702Tk6ym2IRXg5laTiPVUAirLdiDVBxBDSYuBKDf 5aCnZwBSIHT3JHvHr4WNehDB2YPW7ukCwZeQSLgpRrpdpq6MJ4VWwUgVkMt7GBO+v0Bo 17KCCOX4XDRinEbBAXC5R0pNW+ISijTZdg+39ZmSzVWejOlR53ZS00Jq2tcuD76p7ROg X9rg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:organization:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=L8oDoF0RtiYuawM9qKNCm5v3ts9j6hSGWKbVhHFndIE=; fh=pSeRbqcOZxletRhgVtJUdWiAqVKkUj+fpzHCj+45pSo=; b=S8MPmzoyNASX43MggxaxKpeFLS+Xvjy3TSwXX87bmdOrfBXEb83uoRJaYt7T/K6NlB f7IXhfM2jJBaYnfNlmCEw99q7u0VpayfNtVFc9pJqz/O4+VVM0S/hnLfrrNGR+CD4SmJ el2p9QsgNIxvNnBK6A4zNoPdTlarT8xV9M22pBEN0hqeyiAjkjomKNNpZj9jYI8tb9w3 i1OsmeddUKCOL3JHjpidU5B+XoN9rJim0LDp2Av3x0ZqIklLSP8IdGRnV6a0xMPgmx2z tQiL/a9OXrlwG1ZCoyBUni9vrR9A174RAVRyVGjgKlWA+9vU1BhcQi0WnO+zOdpvjrWR rojQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@egauge.net header.s=google header.b=TogU+6Yx; arc=pass (i=1 spf=pass spfdomain=egauge.net dkim=pass dkdomain=egauge.net dmarc=pass fromdomain=egauge.net); spf=pass (google.com: domain of linux-wireless+bounces-3268-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3268-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=egauge.net X-Forwarded-Encrypted: i=2; AJvYcCXA4u0WqbcyzjJkAZncCsEowDgi1vjRbqFVhWZZUX9V6dq3nEpvmRPNHBTxQ/RLEqUIll7u6sN0xKpaWRsTz6IBqRjoqzZR46ekIufalA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e8-20020a17090a728800b00296db812c4dsi724434pjg.116.2024.02.06.21.00.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 21:00:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3268-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=@egauge.net header.s=google header.b=TogU+6Yx; arc=pass (i=1 spf=pass spfdomain=egauge.net dkim=pass dkdomain=egauge.net dmarc=pass fromdomain=egauge.net); spf=pass (google.com: domain of linux-wireless+bounces-3268-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3268-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=egauge.net 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 51EE2286AA6 for ; Wed, 7 Feb 2024 05:00:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C69121CD19; Wed, 7 Feb 2024 04:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=egauge.net header.i=@egauge.net header.b="TogU+6Yx" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 249A91CD1F for ; Wed, 7 Feb 2024 04:59:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707281998; cv=none; b=pWiwQCmb0c0SatpzoDHsyreBFNMvxVrRE75rF4FyjWX3SKXcPUn7HhaRqU3Q3PWI3kEzQXzUKWg8eYRU/Qs6i8jBotd0BXBcZpMte+gTrusiqsWuITvQQ67k3OXDiwf6I/BgC6rz50zKrVAT0lGWmJ3E0GB1t21eks5bgWY6k9A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707281998; c=relaxed/simple; bh=fF1XrFVEhMyD+k3GYMNnjvNQOnQz8MRSGXawhTk/hR4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Wrw9XbWJ+ODzUpbWSi6kaT1Ex1oSmROFlHyXp80E5jqxqa0je4NkMFA0l4BnH5gglL+OfNg04/NMxbnc9iQqpVG+A8md7I24ELmSMSWxpsuJyrXAfDLcU4DXBtthoOM5AsUJwVhdEdDhGKktocsLoYdeE0T+Jh7ABMp030/A/Xc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=egauge.net; spf=pass smtp.mailfrom=egauge.net; dkim=pass (2048-bit key) header.d=egauge.net header.i=@egauge.net header.b=TogU+6Yx; arc=none smtp.client-ip=209.85.166.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=egauge.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=egauge.net Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7bed9c7d33fso9979239f.1 for ; Tue, 06 Feb 2024 20:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=egauge.net; s=google; t=1707281996; x=1707886796; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:organization :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to; bh=L8oDoF0RtiYuawM9qKNCm5v3ts9j6hSGWKbVhHFndIE=; b=TogU+6Yx3jXr13VywVDnwyKimiX3ChPY0UBc51FQ0jxnGKyAkj+d+COzlKOmcvoE9q Yh0uWD+2B39clxK6BEQSpznIhz1ijo/sqIsiDbxGGjzni+NvcO2xrUCK8Kef/twjY7i0 FO/xPRLA+mcV6UsLt4XX8WRSvQZ6ZdIxemdHmm1DrxKq3dkpJssBpHgFS7GYf83atENn cDxK3qvwGmykxCcSA/q6jN3Nbev5Y9WnX157/sy2YVQJk6IlwAOp+x4dJjd1IfBubbp5 xzIJMsPrQ+ejDovQPpcbLkYWuDf1fGPD15RLcFg9qb/X20/Sx0kkN1w3hOu7MsjbgVgx 6ydw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707281996; x=1707886796; h=mime-version:user-agent:content-transfer-encoding:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=L8oDoF0RtiYuawM9qKNCm5v3ts9j6hSGWKbVhHFndIE=; b=N4UvPhibJviKJa9wO1g6u3Cnvxa3ta1xljpcCNRmIKqLCKbSJM4JxyflrM6e4hlQHk 0zuZgbLY9684XlOQEI07rmPiz6k09rZu6+UO8B/0N0LjqZCwMlnHeV9j+n6J2Sw0Nv5E 34+OR442SgeV3kTrr/QqvCwnNz7RUqYQFcy+mN4JjgpbSdT5nMXltQLqybM6jar2FBu0 KxgJGU0D/4cWHgxWfnaTNqFjrpEa9yEA2ZEQ5ZRaA6RG89qJivKDVfHzqfNuHNzpMnnr IAY5C1g4yYnRGlonYx99T9GL9rh7fFvimiNaf+GcPNB2HOx0XW6RGGlGmN5ivE2Sy0FV Wctw== X-Gm-Message-State: AOJu0Yx4VxExGVahIEzc5sfCNyy9smx1qrav8EJHS5QEE6qzgG3KemvS 8jKrBs6hTTxbUNkvfG2H0sivDSgBV2X9v2KXxxLLnmF9gDAuPCCdNTAX9IfE4lbmWXrx8P2HwTw = X-Received: by 2002:a05:6602:256d:b0:7c3:e8ea:cb2b with SMTP id dj13-20020a056602256d00b007c3e8eacb2bmr5258973iob.8.1707281996140; Tue, 06 Feb 2024 20:59:56 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU6x9tJznwjNO2uO3YELHeuU+zDJREwtceEm/oL4zDx+tMU73Psw38lfYjlKqrpkW7M6yiEnkNXLztoxPblVyuC7gX0m0g3KCc0AqDKZbdmdFCQmNvowrlwtNly4086dEAgIKp9fQ== Received: from ?IPv6:2601:281:8300:a1:5d8a:622a:58d5:54e0? ([2601:281:8300:a1:5d8a:622a:58d5:54e0]) by smtp.gmail.com with ESMTPSA id f22-20020a6b5116000000b007c0126a5a38sm92975iob.46.2024.02.06.20.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 20:59:55 -0800 (PST) Message-ID: Subject: Re: [PATCH] [v4] wifi: wilc1000: validate chip id during bus probe From: David Mosberger-Tang To: Kalle Valo , Alexis =?ISO-8859-1?Q?Lothor=E9?= Cc: linux-wireless@vger.kernel.org, Ajay.Kathat@microchip.com Date: Tue, 06 Feb 2024 21:59:55 -0700 In-Reply-To: <87cytgv6nt.fsf@kernel.org> References: <20240127004331.1334804-1-davidm@egauge.net> <415a0e6e-5824-44a2-af2a-a75115d5a62e@bootlin.com> <87cytgv6nt.fsf@kernel.org> Organization: eGauge Systems LLC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2024-02-01 at 12:08 +0200, Kalle Valo wrote: > Alexis Lothor=C3=A9 writes: >=20 > > On 1/27/24 01:43, David Mosberger-Tang wrote: > > > Previously, the driver created a net device (typically wlan0) as soon > > > as the module was loaded. This commit changes the driver to follow > > > normal Linux convention of creating the net device only when bus > > > probing detects a supported chip. > >=20 > > As already mentioned multiple times, I am skeptical about the validity = of > > keeping netdev registration before chip presence check, but I am not th= e > > maintainer, so I let Ajay and Kalle decide for this. >=20 > I haven't checked the code but as a general comment I agree with Alexis, > registering netdev before the hardware is ready sounds odd to me. I agree, but it's orthogonal to what my patch does. I did a quick scan and it looks like the cleanest thing to do would be to change all the code below "Spi Internal Read/Write Function" and "Spi interfaces" to take a spi_device pointer instead of the wilc pointer. The probe code could then safely call these lower-level functions without having to worry that they might inadvertently access a part of the wilc structure that hasn't been initialized yet. From the looks of it, that would probably also shorten the code, since many calls to to_spi_device(wilc->dev) would go away. However, it'd be a major rewrite of spi.c so it better had the buy in of the maintainer(s). --david