Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp299040lqd; Wed, 24 Apr 2024 02:39:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXm8JZX7B9nJzCWttJsw6fqCDirVoaeKUnMAYoxawzX8/nQZxkIZqrpquKHfhL3BlkLXOoBt+thaTzXDQatTYAk3uOM2l064PGFBEM/5A== X-Google-Smtp-Source: AGHT+IGDwHmxe+V+E6xhuO8hYmiJLDRju/YHj4lN3+L5eMPy1V4CzrdWYj3QMOMl8xUzOF+F/3ww X-Received: by 2002:a05:6808:b0d:b0:3c5:f293:fd33 with SMTP id s13-20020a0568080b0d00b003c5f293fd33mr1693466oij.24.1713951566456; Wed, 24 Apr 2024 02:39:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713951566; cv=pass; d=google.com; s=arc-20160816; b=GSPBjIoCsH464VBS+baU32CH+K0B7V8Plvvdi+pCPPG2KcTCx0TUNcTJ5/NRh58Lah 91MJs6Q4S3LaTH9c9GQjZSP4Wo2zwSXPze2f0G+sXbZJgW4lr+L4zfF5zbW5qCXlOWgq mVmMC0EVbdOpaKrLwShR2BeCLDYbC0AdVRW87gaQq4ccfxeWhd2CxbiCF2Nog3Lbp7N7 RoPx/t9fvnWuy3Z4Lg3zYCbFyHzvnKxHfD2jm8n3GsTgTvxWXFBy04n3ETHV5yDrtW8x /uYdYegZ+uPjtnZ8k9a2WujqMDiSWQmXYCNc8XobVxLOAjvmnY5/aGjxQ1sqsHe3wjMZ v3qQ== 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:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=ZieGXy2W2RNsFYzvlE4thhjUPgqiStF2Ihyc9LjNzuI=; fh=dOMLs8tQZrbR1kKGN4s4yFYuMJnaZ+mjYNoMt3n9+ck=; b=Inq8mdUC6uV0cA5qyQ5Dovq7OFpHzlgweEGocol6fVm/vE8Uo7Q0E5oT6WZugzT4DJ YqfnXTT/AB65KYf8DErlNDgOayjX6MtZtOeyUSs38hWgAXXVcr6Okbp8AzVQk8tJDBlB 6tHJCQiYls/ESZ5KEKs9OZ234pz1LNOpMWjfENob5nGIK3YLch6JT6f8VO9mRf55fNpB p7pue8u6m5O3Ex4JYm89YHVlWwloDsHbeeWoKHsIxUpHqEHioKzYGCtVBjMnJklOTa9q sO/B/SpmGgsFMzd+h34xFrAYA4XCIaZ1ooJxh1miPeK+71R1KAdDAQlcQe15hGwl7OFI Ij1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WNzwHM8g; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-6761-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6761-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z15-20020a63e54f000000b005e4c83e4f41si10995421pgj.183.2024.04.24.02.39.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 02:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6761-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=@kernel.org header.s=k20201202 header.b=WNzwHM8g; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-6761-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6761-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 101E0285988 for ; Wed, 24 Apr 2024 09:39:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 923F0158A39; Wed, 24 Apr 2024 09:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WNzwHM8g" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 69DCA1EF1A for ; Wed, 24 Apr 2024 09:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713951565; cv=none; b=t1NzRRYOcO7ag57Umulb8zkQmsGX7KE1E9mxD4VIoXMkbKMQbs4q35iLxtde3luq1jkpGN4d086y3FDjmWJSIViu2M0hKKbQx2QdyMqBm5FuBXZ6pBBsUzz8+pmSzyVSKLILxHIu7kcJi1oAHMjad9AhpX5IDm5VN9fmN81W6pM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713951565; c=relaxed/simple; bh=GUIlLkif8keejqDQqKOkW9EQrA1+ijV1H3EyKQjskfw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=Q07KiI/WJtloFiOKMH8NYJnQc2J4ZGi11ckuFxBee+b0WwmJYKdawSb/sga1IyqI+CDf7mbssZ0XFchKfC8kg83PUDFcJMI7o0Pk7yC8ah69fb8W/IBaVB89XUsm99CLTp8nmYQvi5QY3QgTXlJkiWAz4ciNCHbicXW9jsXDsKc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WNzwHM8g; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01C2FC113CE; Wed, 24 Apr 2024 09:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713951564; bh=GUIlLkif8keejqDQqKOkW9EQrA1+ijV1H3EyKQjskfw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WNzwHM8gw8qQj5lZ9kTqaCfk+IsJoUwzTwOqm2LQleRnp1evX4zvo7ieb0J7NFL3W rx2YlMTL32rBqESPwHshSYhc6BBYocL3kah1koOKQlCHgfHEj85gRlib3DfVBo54L/ n7Bt78Kswcv0jBNPiKcG8lVad/nghY5mJSVUnynz7JjPN2FH9IW7Ez2tJfqEEZRgBr n8yqLp9ihF6LhcdzwvwiN1iau7V+cdYn01Zx5QlgEWKwmEj0oryF4ghGRE5GKf1rbL AT6qwnNvOfOPhh27XQPy9sHVvtRWFNqlvXu1zu/lRhQXo/g/ZJ90FvTP3VIvemdxyH ScPrYPy8znSCw== From: Kalle Valo To: Johannes Berg Cc: Karthikeyan Periyasamy , ath12k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH v2 3/3] wifi: ath12k: Add lock to protect the hardware state References: <20240424065646.1666166-1-quic_periyasa@quicinc.com> <20240424065646.1666166-4-quic_periyasa@quicinc.com> <517caf852d37b3803bcf087a6b575f2ecdb5ba10.camel@sipsolutions.net> Date: Wed, 24 Apr 2024 12:39:21 +0300 In-Reply-To: <517caf852d37b3803bcf087a6b575f2ecdb5ba10.camel@sipsolutions.net> (Johannes Berg's message of "Wed, 24 Apr 2024 09:28:20 +0200") Message-ID: <87il07t7zq.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Johannes Berg writes: > On Wed, 2024-04-24 at 12:26 +0530, Karthikeyan Periyasamy wrote: >> Currently, hardware state is not protected across the reconfigure >> operations. However, in single wiphy models, multiple radio/links is >> exposed as a MAC hardware (ieee80211_hw) through the driver hardware >> abstraction (ath12k_hw) layer. In such scenario, we need to protect >> hardware state across the multiple radio/link at the driver hardware >> abstraction (ath12k_hw) layer. Therefore, introduce a new mutex in >> the ath12k_hw layer. >> > > It's your driver, but ... it would seem _simpler_ to do locking across > the hw with a single wiphy model, because everything (except currently > for ath12k_core_reset and ath12k_core_restart) already holds the wiphy > mutex. You can probably move those to wiphy work. > > I'd avoid doing lock explosion like we had in mac80211, it's going to > come back and bite you eventually :) Exactly. Swithing to use wiphy_lock() definitely one of my longterm goals in ath12k. I already started working on switching ath12k to use wiphy_lock() but IIRC I got blocked by not being able to call wiphy_delayed_work_cancel() without taking wiphy_lock. One way to solve that might be to convert WMI event handling to use wiphy work but didn't have the time to work on that so I put it on the backborner. I should resurrect that branch and submit it as RFC. But for the time being I think we need to add another mutex to ath12k, I don't want to block Karthikeyan for too long. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches