linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
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>,
	"Dan Carpenter" <dan.carpenter@linaro.org>,
	linux-kernel@vger.kernel.org,
	"Alexis Lothoré" <alexis.lothore@bootlin.com>
Subject: [PATCH wireless 3/3] wifi: wilc1000: document SRCU usage instead of SRCU
Date: Tue, 28 May 2024 16:20:30 +0200	[thread overview]
Message-ID: <20240528-wilc_revert_srcu_to_rcu-v1-3-bce096e0798c@bootlin.com> (raw)
In-Reply-To: <20240528-wilc_revert_srcu_to_rcu-v1-0-bce096e0798c@bootlin.com>

Commit f236464f1db7 ("wifi: wilc1000: convert list management to RCU")
attempted to convert SRCU to RCU usage, assuming it was not really needed.
The runtime issues that arose after merging it showed that there are code
paths involving sleeping functions, and removing those would need some
heavier driver rework.

Add some documentation about SRCU need to make sure that any future
developer do not miss some use cases if tempted to convert back again to
RCU.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/wireless/microchip/wilc1000/netdev.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h
index 5937d6d45695..fde8610a9c84 100644
--- a/drivers/net/wireless/microchip/wilc1000/netdev.h
+++ b/drivers/net/wireless/microchip/wilc1000/netdev.h
@@ -220,6 +220,13 @@ struct wilc {
 
 	/* protect vif list */
 	struct mutex vif_mutex;
+	/* Sleepable RCU struct to manipulate vif list. Sleepable version is
+	 * needed over the classic RCU version because the driver's current
+	 * design involves some sleeping code while manipulating a vif
+	 * retrieved from vif list (so in a SRCU critical section), like:
+	 * - sending commands to the chip, using info from retrieved vif
+	 * - registering a new monitoring net device
+	 */
 	struct srcu_struct srcu;
 	u8 open_ifcs;
 

-- 
2.45.1


      parent reply	other threads:[~2024-05-28 14:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 14:20 [PATCH wireless 0/3] wifi: wilc1000: revert SRCU to RCU conversion series Alexis Lothoré
2024-05-28 14:20 ` [PATCH wireless 1/3] Revert "wifi: wilc1000: convert list management to RCU" Alexis Lothoré
2024-06-01  9:59   ` Kalle Valo
2024-05-28 14:20 ` [PATCH wireless 2/3] Revert "wifi: wilc1000: set atomic flag on kmemdup in srcu critical section" Alexis Lothoré
2024-05-28 14:20 ` Alexis Lothoré [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240528-wilc_revert_srcu_to_rcu-v1-3-bce096e0798c@bootlin.com \
    --to=alexis.lothore@bootlin.com \
    --cc=ajay.kathat@microchip.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=dan.carpenter@linaro.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).