Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp98260lqo; Wed, 27 Mar 2024 07:58:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7lL9Js6q2yFrAfZucMZHxrX71EBHVeDFYf9QJ7dHHEr30Hs865PIUW5dv6yFp8y4moAJuVyZt389MtOhMkNYPF0S8xIUz8sBnoZhReQ== X-Google-Smtp-Source: AGHT+IHqCix9266dIfBZ02lfUWLS0/6N0yYImdUYd4X6Qvk7xnGqvj5pcHWzcu97X0oJ93wJENuY X-Received: by 2002:a05:6a21:999a:b0:1a3:bd9a:4255 with SMTP id ve26-20020a056a21999a00b001a3bd9a4255mr242247pzb.5.1711551479914; Wed, 27 Mar 2024 07:57:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711551479; cv=pass; d=google.com; s=arc-20160816; b=hhiFDBLc8dBxL31M9tgzXS6E/6uBV+apMBl5gtTlogVhzFh11HbgY9l8Q9+hAccK1C 8wFgIrkeo9P6qLYfnBQ3icav14QVuxX09LRgz2YyckDWIcAXs42zZ7QpE/coMwZFnDCi zoryqmt1929fO344OJk/BeyIL0sBg+i9MZ4Jto596VDlXEgn60N1b0fPELkqSf8C+DrN fwAylygPfQaAN09RiCvMqF7W8Wo5bUfWCdNDJHpozeGbQ7H2M8jqtTdDPkuBFY6XtN90 SDnq6lfXLFdMAIaPeRw15XZPWjSiDvgrwiYoCUk8j2FNW+DhRA3YXi8IWGySgKYDT8Cd Kkdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=VH85LDanshnEfH59gVgWxhjvg7DEyyk9asBNYPxNyJU=; fh=5VOKYfA0z0hhqaa7N9aOFnPvD/7izmCaotD6JrStmsY=; b=1AYKUK88V5LZaK274zeLrowGp2RfjLG2cpxfvG12wW9IJ8//QVAvcJIfmTlZV03eM2 Rk4W1d4+xHXGUR1VHiBLtulbNYlNwvpg0hEpZWD1bhY56bPJHiitqg3ynk0KHzb98HlI Fk45Z0cWXrR2C1+qMr6001B6xiUEPR/zfTDimEjctEA6RTJECypGgaD4oc2syL5bkxMi QA7fuJMDzJgk56kkyZrjK9gigBHX0jEAEQ1rL3lW7++Wpcsj3zapOBESR3Q+Zajz2YNH 4dhw/eR9ok8gdp4ZicjlC7vbBwGbvWlLigfecfy2TvdpqtZi2wqGqcfmtH3Q3mfaH9Yd JBcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a7Wd1DX+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-5359-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5359-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u10-20020aa7838a000000b006e6c736da26si9301325pfm.79.2024.03.27.07.57.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 07:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5359-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a7Wd1DX+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-5359-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5359-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8E28A302352 for ; Wed, 27 Mar 2024 14:57:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F942130ADA; Wed, 27 Mar 2024 14:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a7Wd1DX+" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 568C812DDAF for ; Wed, 27 Mar 2024 14:07:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711548446; cv=none; b=rXU/WN4E83LvARlQd7JWN7+BKoepsRll17E1BmfE3ufbJ7wau3YsgU5sepRiKiUDosru8/0gcgGnfqo4+kEaSZg8c1IAbUtYal3AS69kQ/teNtwKqCvnPcOg3CavKKGJD2AdDixJcEyWX1FbN2gTk9AW5b6nlrkW8XKF5qQKf7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711548446; c=relaxed/simple; bh=AIxyzss0uu4ZqGcEZaGkisgWl4oNWJ4zMn27fRqVTDc=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=s+PZ6vhUuZgiIZajyHtlLuDR/X44l0u/TytvbsvyafjrXH7ytnvHyF+2Z7tp0g+injm2Upo/ZTCF2qx+6QmymHx3uca7TNNiaU6giNVWgg91I8SYfRoslo/Art0MXresloO00NHp0BjYs+NjunMDVdNb9ZkiJ/UU1BOtT25bmH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a7Wd1DX+; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2d46dd5f222so80479371fa.1 for ; Wed, 27 Mar 2024 07:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711548442; x=1712153242; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=VH85LDanshnEfH59gVgWxhjvg7DEyyk9asBNYPxNyJU=; b=a7Wd1DX+YnhqILLF1ShvTTeKQQ5tEnXY1Lw/fOzKxNHiiN9ACZTfw75e+1g9lobXYf Y3MUhFJue15D8HJ8u3Dg2pWRKwYLpXyALEEQ0IG77pwd+37BB/khJlwvozbukrvKg1IE ZcTkIcDNhdAe/gt0aDHI+QvP8c2DiTh6Pc7Cke2KPDDuM7OFClntvMJ7FM0FLJzXCIF3 NibVSgB8bSeWUkHxVR4i+r8flT+w8G7GvMgv12b5ric+IAhqbLsBQrIbviluC66M3beE IhUjs7xx6YpjAO1mwIW3qJeqmta9Hw/zefLQ+sk8eQQsdbVlQtoEL/y5cZ97vlXnU0lV Dn6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711548442; x=1712153242; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VH85LDanshnEfH59gVgWxhjvg7DEyyk9asBNYPxNyJU=; b=WvIbZ8OjNDhfnBg+Ktjr6XFYwINr5IzLTUlUnFg4wRRd8LV/k10wv83T4HmEtlbfpY xXFyQuHyeaEsqueRZVfgjE+DzQtfKK+xrkb7y8w21J9phmsf5dvn9lzl4GK7bRnJzjFP f0ww1frq4EBpH7b9gYwb4XkK0iM/qvtwi27sTQ9Orpn+gGEEmo2EswVpN7pgJP2eONIc bCYLSGBQkrqckPOuDIIa01PbIYf8NlvhmLqp4Iw3JhV4KlDteIk8/qxLyv811MJT4yyw PEOMvn6sfa5XTSTNhGcUPI1qmhJkkWFXsOI347OltLqz5SYbZMZjglDqEN+0JJ1XOn3e oESQ== X-Forwarded-Encrypted: i=1; AJvYcCWrxBFhDxFJhVcoX1/Oo/nui0g7HWA/e90ER63m9PkD9jAIVlWf0FUNNPP1BpI4GdFY4zSxDNVEjsnl8d19rMOtPLz6QBSugID4qk8wdTk= X-Gm-Message-State: AOJu0YzqFhOLfo+A5ykPlZ2DlQseKB3eio1YJ0AQ4Te4pko2PboZ8bfR k4Trwv2fL4Vx10uKV8pfeAtMIfC7b5rN7vvC/sEctQJUcAc2uuj4usIFQX/g X-Received: by 2002:a05:651c:2124:b0:2d6:a33c:66f8 with SMTP id a36-20020a05651c212400b002d6a33c66f8mr161592ljq.4.1711548442207; Wed, 27 Mar 2024 07:07:22 -0700 (PDT) Received: from [192.168.1.50] ([79.119.240.188]) by smtp.gmail.com with ESMTPSA id b15-20020a05600c4e0f00b0041494665db1sm2113197wmq.15.2024.03.27.07.07.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Mar 2024 07:07:21 -0700 (PDT) Message-ID: <66565618-3638-47e5-afe5-3530214da0c9@gmail.com> Date: Wed, 27 Mar 2024 16:07:20 +0200 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Bitterblue Smith Subject: Re: [PATCH v3 11/12] wifi: rtlwifi: Add rtl8192du/sw.{c,h} To: Ping-Ke Shih , "linux-wireless@vger.kernel.org" Cc: "Larry.Finger@lwfinger.net" , "s.l-h@gmx.de" , "chewitt@libreelec.tv" References: <7f4b3309-1580-48f3-9426-29f1eb4052fd@gmail.com> <2eb79c8c-cf2c-4696-b958-e8d961628e17@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22/03/2024 08:04, Ping-Ke Shih wrote: > On Wed, 2024-03-20 at 21:43 +0200, Bitterblue Smith wrote: [...] >> +DEFINE_MUTEX(globalmutex_power); >> +DEFINE_MUTEX(globalmutex_for_fwdownload); >> +DEFINE_MUTEX(globalmutex_for_power_and_efuse); >> +DEFINE_MUTEX(globalmutex_for_mac0_2g_mac1_5g); > > The consumers of globalmutex_for_mac0_2g_mac1_5g are complex. Why do they > check mutex_is_locked()? Race conditions between two instances? > I couldn't think of a sufficiently short name, like "lock_mac0_2g_mac1_5g", so I used mutex_is_locked(). That's probably a bad idea. It should be like this: /* Let the first starting mac load RF parameters and do LCK */ if (rtlhal->macphymode == DUALMAC_DUALPHY && ((rtlhal->interfaceindex == 0 && rtlhal->bandset == BAND_ON_2_4G) || (rtlhal->interfaceindex == 1 && rtlhal->bandset == BAND_ON_5G))) { mutex_lock(&globalmutex_for_mac0_2g_mac1_5g); lock_mac0_2g_mac1_5g = true; } .... if (lock_mac0_2g_mac1_5g) mutex_unlock(&globalmutex_for_mac0_2g_mac1_5g);