Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp308058lqd; Wed, 24 Apr 2024 03:02:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4aUBUtKLroi5gsiIDggTatgMTb5Zye6e8X/Mg6O0FcY+NsLbaLqWSYAeYpPBD769vcZkqydjXYbZakKQ5tOX70gDXyrTUydG8ItJfow== X-Google-Smtp-Source: AGHT+IHfn9VxzejtEwbImF492v51pzU5qxwrcMAdViS2F/fRhpmaggogKJ4N9x96O0wpbYETR8jl X-Received: by 2002:a05:6a21:339a:b0:1a9:90b8:1c13 with SMTP id yy26-20020a056a21339a00b001a990b81c13mr2647027pzb.12.1713952972318; Wed, 24 Apr 2024 03:02:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713952972; cv=pass; d=google.com; s=arc-20160816; b=cIy8SAmjZwSPYSGRWfR4iLaJ2/+hlMb3q+1vzfSrgNnjQ4dY2p8Zmp0FD2ubSCTWEM 2iyObdJNLynIRBMRYIgfi9B9GD0re1p96ZtR8Lush2rzJGg0CMy9VZD2IGMt0X8hjr0+ iz4FAJBEXDiyJ3h/bP2Mp1whhaP8phtO5/j3pOOgPYzA+h1bV764bJ2NJXnCdkGXDyDe eeDNTChfAf52h5DMD1uTIOZqmw095cttM/gTTQtGQ5FWjfzi/kszhJiWICBLAjL+I3hv Tcg0AYmIu9MqeuyeIz9/NLLjQydQ5+ISHznOiTmAPDcTcy5139ZzBrN5PRgwKHQ/RlSe TJCA== 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:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=KExW29pFg2U1j32PSnZKZGEMbN+QiSoNNAFNVkXT0sg=; fh=ngwMKqLuURP/ERGe8jtaITUiO6Wz5T8Nu6dn0WxXLsE=; b=rmb3FfGc+LxnQapsGDCpOYuJ43r0pVI9uV6sF9KknHkQ8vBFuKKawagXZZiIBcTAUq CrkoYqXWvCqRoMuMgpZ4FrQuWvLOa9MDkIHIPvtppfw7j9TwfbXqukp1fCWpUG4xszb5 LlviCzb7FakI0JnV3FPEZQaca0ifkBiPs6SFgTxBJjA7mecB/hWHmdSyqY50vP6ksPNE hygFLKGzH08XuQGZgDu3IZAi/SYxHjLfIDn2ZaJgCGejdXWHeBQ5xdNjdUKDPA6S/0+J gCbGPin2Nv+eCf4twoK4FDizt7ZXhJh9E1R3vwwDSriSs9dbu2rY/8oXH4WAvq89oY0j 2S9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="Uo0UDld/"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-6764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f12-20020a056a00238c00b006e6bcbccd85si11348358pfc.22.2024.04.24.03.02.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 03:02:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6764-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=@sipsolutions.net header.s=mail header.b="Uo0UDld/"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-6764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.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 9F7C2286B49 for ; Wed, 24 Apr 2024 09:52:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA469158DA1; Wed, 24 Apr 2024 09:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="Uo0UDld/" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 48E3F1581E0 for ; Wed, 24 Apr 2024 09:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713952347; cv=none; b=Gg9jEvkC5eBR/fJAzNipO8EhNse1I2FJZSumDtZkOIDp8Zitq8PCzar0Gug2j6EM1+0KRPm2VvD7sVbkTTo3iYMh5+j8LnDQf0wvfpjwSITAkUrQFlHs9ppEHgA+q04Nq2RwfRak9HVl72WBW27FX/7HXLrMP1OsKXySDmXDRFI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713952347; c=relaxed/simple; bh=KExW29pFg2U1j32PSnZKZGEMbN+QiSoNNAFNVkXT0sg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=bN3yik9yCCdjR8UsmXDyEc+aCXJRL+HqVq5Owngk6b9rZCgd6xoiJlubiSydlRNYDfF51V82byDyODI5KHvx8u3CSK9LFpmfEV/RSavXZffLtN+5Pl3QlycDnxB5qTpHaT8UwsPLXsFTfjPX3Ts0Xqcu7ygBjCgoe7fLvyQThTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=Uo0UDld/; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=KExW29pFg2U1j32PSnZKZGEMbN+QiSoNNAFNVkXT0sg=; t=1713952346; x=1715161946; b=Uo0UDld/lDfDF2tqv2zd3IJ8+Hsxc1nxjJxphiekZf/seZj xL3wqM/A49HNbg3FkBtUe8N9YIJX+1VVgD1PjEOverA4ZRKuM0Jo9e1BGS4EtZHpHz+RLwxRX/iEX 1/5acC36xWS6QHOayNKd6jxTao176o/erJpLwRJHm+o8ELtrR4hsFLMi7xkCLRtMrKoy9ov16Hdfz 2S7xRYahWliMcVKIFM5swLLFCSGbxSbJXao6vA2UK9loHCIq8JJJegihloNq9QSV7/gMs5oIyhaPT 9TlLtIOLAQx/Lb+Ka3C3Pk/adLLu2pHRxqhvlZhndgv7X06QVrZuP+alHmC6Jgwg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rzZId-00000003Us9-0tSA; Wed, 24 Apr 2024 11:52:23 +0200 Message-ID: <0bfbb5549b48296e6219488d47caccd10e818700.camel@sipsolutions.net> Subject: Re: [PATCH v2 3/3] wifi: ath12k: Add lock to protect the hardware state From: Johannes Berg To: Kalle Valo Cc: Karthikeyan Periyasamy , ath12k@lists.infradead.org, linux-wireless@vger.kernel.org Date: Wed, 24 Apr 2024 11:52:22 +0200 In-Reply-To: <87edavt7h8.fsf@kernel.org> References: <20240424065646.1666166-1-quic_periyasa@quicinc.com> <20240424065646.1666166-4-quic_periyasa@quicinc.com> <517caf852d37b3803bcf087a6b575f2ecdb5ba10.camel@sipsolutions.net> <87il07t7zq.fsf@kernel.org> <3dc4339f5c3f603027c2214058e7e3251652a7f0.camel@sipsolutions.net> <87edavt7h8.fsf@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned On Wed, 2024-04-24 at 12:50 +0300, Kalle Valo wrote: > Johannes Berg writes: >=20 > > On Wed, 2024-04-24 at 12:39 +0300, Kalle Valo wrote: > > >=20 > > > 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. > >=20 > > That's because I didn't want to have an async version, but theoreticall= y > > we could have a version of it that just cancels the timer. If you don't > > hold the wiphy mutex already you could even wait for it to finish. It > > just adds more complexity there, and I was trying to make it all a lot > > more obvious :) >=20 > Yeah, understandable. I think changing ath12k WMI event handling to use > wiphy_work makes sense, running them in tasklet context feels overkill. Maybe. Note that the wiphy lock _can_ create delays etc. here, if you're doing other configuration work at the same time, or similar. Though I guess eventually you need locking there anyway, to access the HW. So it can be a bit of a trade-off. I expect this will evolve over time even in mac80211, though so far we haven't seen any bad effect from it. johannes