Message ID | 20240215-wilc_fix_rcu_usage-v1-0-f610e46c6f82@bootlin.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-67204-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp483054dyb; Thu, 15 Feb 2024 07:38:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUMzGEMKNWuwvRuhWDDHLlpIwXgdCML/Ntat2t9L32GZv0BAiBuIb9x4WK03dwoCouFzyaHFzPNGs01WZIryIa8pKOeDA== X-Google-Smtp-Source: AGHT+IEst2otSAjwMsdAxZxpJceMgqCvUjtSfYnH2+wn9GhrcbsIt0CwIexCLbdcn/CiE88huQ9u X-Received: by 2002:a0c:f594:0:b0:68e:e3b7:557d with SMTP id k20-20020a0cf594000000b0068ee3b7557dmr1840661qvm.25.1708011503111; Thu, 15 Feb 2024 07:38:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708011503; cv=pass; d=google.com; s=arc-20160816; b=bSIq8/hOSJTs14zMKDPONjGEYp1IXRsBhD86HShcGit49XAbWZfc9kzyH6O0INNjEG tJElz+mAHr8vTF77cXCUx/d1susPQaw7szc3AlRKhklAqINWmt/u92fQGw+aMO82mHPb Nab/ZkL4uAFDHcPS6sLXrM1RzIDBxdoUCDyLFIN9yfw4+9whETW10BfNe7jMSIRM2T2r 7LIC3L6X7O45y1Lwx787GqByRXgF1hbCTpIv8fmV6xx2n5KZgzxoQcQa/nADlGsUgOhv KVrhEe+Nj5raGT7pDlk0WfLECZnuTNsZipL6AiXxaupHhHnUrki4tgHoE/G7NI0juao1 uyfw== 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=iYpBy2pOkbObWUArx2aSecO+YI6aKHJRe0UxQNbEakU=; fh=hf7yt6gAq86lBfLhZUgknSIsFJxesf1c5mfeIKl6aZk=; b=mOWF8iGCZzcrGpD7U6hLkII9JzVVO36OCQnGgNk1NtTWxOaR3hTSAWiLsGDOjbXYHc 4+y27bSb8hkMesVASSKjkUtaKulPLDtJiNYAoht/1w8H1zPtx2iV6iASlVlaUMLIDDWa AbyQZTZ1RD4UzX8t9PdSEdeUVn9A9sV1pkTdEcrZ+PW1dTm3Ki1Cuvm50YaJ3E+Givgs Opvq+0ahzWdfIXwoKhZpMpI/MrXVTmNHK017Z8GC90xdQ+2bBVh4djaCWQ2NIKAd1gf9 bT7APbNFiMz/JcfUAF0LfjZMrfxVUrnfIrxEtku6CFXh1/VFKiKbt9WtwYZyVzFuLdht sLqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CDJn+Zj6; 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-kernel+bounces-67204-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67204-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id kk12-20020a056214508c00b0068ed4e35e17si1584092qvb.379.2024.02.15.07.38.23 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:38:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67204-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CDJn+Zj6; 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-kernel+bounces-67204-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67204-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CF3E41C236D0 for <ouuuleilei@gmail.com>; Thu, 15 Feb 2024 15:38:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A70751350CC; Thu, 15 Feb 2024 15:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="CDJn+Zj6" Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 A0EA913340F; Thu, 15 Feb 2024 15:36:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.178.240 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011408; cv=none; b=XcULDlBI9gjpIGHGHiI2UTyDbGJZ5ENVSFUdhu9RAHrvM0prp4ArqoNLSI7MwTi7XO2gaWq1Rpet4EJUFiV5Cbrs3ziuv87GpCAB69o4xsqOKDWTUJWWtlUCV0dMVI/BskSR1tehZiAR9Gcq8PuDgh3SViUd8PHIY/RfTgyoLQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011408; c=relaxed/simple; bh=tySSyhctcJeEq9pwA1Mg9ZwgdQxeizWcyX96KTc+4Y8=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=HsIzMdoQ53WOvKX++LqMHVgl7ltMx+sGBxmt2lcWTboXJjXlYbVNT+0up1KwYmqFS27giK551eR0ZgBlmvodtAqNrgpT6N2vbsAROtpfWE/IQuDCL+rgxkSVz7RJQVlkRo7wJsvX05ODb/wJSKnDIlCrZDEmKgroZ7JGzJgmVUk= 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=CDJn+Zj6; arc=none smtp.client-ip=217.70.178.240 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: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 5D992C8769; Thu, 15 Feb 2024 15:36:39 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 61B34FF804; Thu, 15 Feb 2024 15:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708011390; 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=iYpBy2pOkbObWUArx2aSecO+YI6aKHJRe0UxQNbEakU=; b=CDJn+Zj6JNC+vwzOl7OkOaWZNiubzo69dYM2ZlpacMrYvTUPpdhSBkpnN5Jxbw36gMPJ9s 97aPZ0wgSuOeH8bglwkDO5QG4dOF84AZoKW0cqd6tl53w333SjnG02IwbBGsWNUR/wwYNA llIj8O1Tdq+oKxIi4vwPpUsFKm067gG9hT4bQzDlbJ+xAICW2fxyqpcflppdlTWesGcUQ9 cnpS2d3JkCf+ULAL2zcF3zRe7d2yUXrXdqv8hPtxuayT5kMBbiEotiNLqdpGRBrNE2/zIv pitt5sZ/9KAWUa/Q+QK8V8j9Qr+SraoMXbP19o3BrA9cn35evIfNKR70iCa8GA== From: =?utf-8?q?Alexis_Lothor=C3=A9?= <alexis.lothore@bootlin.com> Subject: [PATCH 0/4] wifi: wilc1000: fix RCU usage Date: Thu, 15 Feb 2024 16:36:17 +0100 Message-Id: <20240215-wilc_fix_rcu_usage-v1-0-f610e46c6f82@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAHEvzmUC/x2MXQqAIBAGryL7XKD289BVIiTssxaiQrGC6O4tP Q7MzEMJkZGoUw9FnJx43wRMocgv4zaj5EmYrLa1NpUpL169C3y76LPLaRQDrYafQgBsQxIeESL 803543w90WGXmZAAAAA== To: linux-wireless@vger.kernel.org Cc: Ajay Singh <ajay.kathat@microchip.com>, Claudiu Beznea <claudiu.beznea@tuxon.dev>, Kalle Valo <kvalo@kernel.org>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9?= <alexis.lothore@bootlin.com> X-Mailer: b4 0.12.4 X-GND-Sasl: alexis.lothore@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790979869461345744 X-GMAIL-MSGID: 1790979869461345744 |
Series |
wifi: wilc1000: fix RCU usage
|
|
Message
Alexis Lothoré
Feb. 15, 2024, 3:36 p.m. UTC
This small series aims to fix multiple warnings observed when enabling
CONFIG_PROVE_RCU_LIST:
- add missing locks to create corresponding critical read sections
- fix mix between RCU and SRCU API usage
While at it, since SRCU API is already in use in the driver, any fix done
on RCU usage was also done with the SRCU variant of RCU API. I do not
really get why we are using SRCU in this driver instead of classic RCU, as
it seems to be done in any other wireless driver. My understanding is that
primary SRCU use case is for compatibility with realtime kernel, which
needs to be preemptible everywhere. Has the driver been really developped
with this constraint in mind ?
If you have more details about this, feel free to educate me.
To: <linux-wireless@vger.kernel.org>
Cc: Ajay Singh <ajay.kathat@microchip.com>
Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: <linux-kernel@vger.kernel.org>
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
Ajay Singh (1):
wifi: wilc1000: add missing read critical sections around vif list traversal
Alexis Lothoré (3):
wifi: wilc1000: split deeply nested RCU list traversal in dedicated helper
wifi: wilc1000: use SRCU instead of RCU for vif list traversal
wifi: wilc1000: fix declarations ordering
drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 +-
drivers/net/wireless/microchip/wilc1000/hif.c | 70 ++++++++++++----------
drivers/net/wireless/microchip/wilc1000/netdev.c | 51 +++++++++-------
drivers/net/wireless/microchip/wilc1000/netdev.h | 6 ++
drivers/net/wireless/microchip/wilc1000/wlan.c | 2 +-
5 files changed, 75 insertions(+), 56 deletions(-)
---
base-commit: f4adde5c2f875c491670bc19f6abae91ae364ed6
change-id: 20240131-wilc_fix_rcu_usage-e60ecdffee25
Best regards,
Comments
Alexis Lothoré <alexis.lothore@bootlin.com> writes: > This small series aims to fix multiple warnings observed when enabling > CONFIG_PROVE_RCU_LIST: > - add missing locks to create corresponding critical read sections > - fix mix between RCU and SRCU API usage > > While at it, since SRCU API is already in use in the driver, any fix done > on RCU usage was also done with the SRCU variant of RCU API. I do not > really get why we are using SRCU in this driver instead of classic RCU, as > it seems to be done in any other wireless driver. And even more so, no other driver in drivers/net use SRCU. > My understanding is that primary SRCU use case is for compatibility > with realtime kernel, which needs to be preemptible everywhere. Has > the driver been really developped with this constraint in mind ? If > you have more details about this, feel free to educate me. Alexis, if you have the time I recommend submitting a patchset converting wilc1000 to use classic RCU. At least I have a hard time understanding why SRCU is needed, especially after seeing the warning you found.
On 2/19/24 17:19, Kalle Valo wrote: > Alexis Lothoré <alexis.lothore@bootlin.com> writes: > >> This small series aims to fix multiple warnings observed when enabling >> CONFIG_PROVE_RCU_LIST: >> - add missing locks to create corresponding critical read sections >> - fix mix between RCU and SRCU API usage >> >> While at it, since SRCU API is already in use in the driver, any fix done >> on RCU usage was also done with the SRCU variant of RCU API. I do not >> really get why we are using SRCU in this driver instead of classic RCU, as >> it seems to be done in any other wireless driver. > > And even more so, no other driver in drivers/net use SRCU. > >> My understanding is that primary SRCU use case is for compatibility >> with realtime kernel, which needs to be preemptible everywhere. Has >> the driver been really developped with this constraint in mind ? If >> you have more details about this, feel free to educate me. > > Alexis, if you have the time I recommend submitting a patchset > converting wilc1000 to use classic RCU. At least I have a hard time > understanding why SRCU is needed, especially after seeing the warning > you found. If nobody else comes in with a strong argument in favor of keeping SRCU, yes I can certainly add that to my backlog :)
Alexis Lothoré <alexis.lothore@bootlin.com> writes: > On 2/19/24 17:19, Kalle Valo wrote: > >> Alexis Lothoré <alexis.lothore@bootlin.com> writes: >> >>> This small series aims to fix multiple warnings observed when enabling >>> CONFIG_PROVE_RCU_LIST: >>> - add missing locks to create corresponding critical read sections >>> - fix mix between RCU and SRCU API usage >>> >>> While at it, since SRCU API is already in use in the driver, any fix done >>> on RCU usage was also done with the SRCU variant of RCU API. I do not >>> really get why we are using SRCU in this driver instead of classic RCU, as >>> it seems to be done in any other wireless driver. >> >> And even more so, no other driver in drivers/net use SRCU. >> >>> My understanding is that primary SRCU use case is for compatibility >>> with realtime kernel, which needs to be preemptible everywhere. Has >>> the driver been really developped with this constraint in mind ? If >>> you have more details about this, feel free to educate me. >> >> Alexis, if you have the time I recommend submitting a patchset >> converting wilc1000 to use classic RCU. At least I have a hard time >> understanding why SRCU is needed, especially after seeing the warning >> you found. > > If nobody else comes in with a strong argument in favor of keeping > SRCU And emphasis on the word "strong"... > yes I can certainly add that to my backlog :) Thanks! Your wilc1000 backlog is getting long, I hope your todo software won't overload ;)