Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp146186ybl; Thu, 15 Aug 2019 14:25:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdHCdF42QIEUv5KxP5lgDoQAKxV2VXUPkqp7i+Q7QE/bsQ75XyJwZRpcuzTLQyBF4xijgJ X-Received: by 2002:a62:be0c:: with SMTP id l12mr7480376pff.224.1565904329490; Thu, 15 Aug 2019 14:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565904329; cv=none; d=google.com; s=arc-20160816; b=i5NI9adKcFuNU+cSY8tZoeOhOnaUj9r2aTI+3FPus1DG/02aNOZ5MHmnMqm0OzXOXx 2BE8/KazGSnqsCbZ8WTnMUxbhwB/eJfD8N+9WzEjrSSMtDitF5BuVrC67ZxSqPRUbJqK QpZCmW7r+ulgqSdEInzbtiy+g4lsXa/pE8Z6aDg68nluzQZzjydCxmml6OL3p3K/W0PT 5GIAajGiFRqcBtPlC535LQpxS4fEs0Rrpt3i/2yaApC8zQ1AM+tiwcNY8apoH2kj4c90 tCWP9uqjNtXhdnCu0ZNvG3V+mWHo5CUn2DCRnha94vuJ03PjDlY8Aaw61JU4T2FUDGbT mIFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6rHFZp7Q9zNEGDrlZI7ThtXxX4J4GssJHaVlX0BDsnU=; b=TSkNDzPu48JC8nJj0OAr2cdYlzPve3rOjEVKpmmoJGWP5OHKLIk6v956gidYDagyyO WyZmYApfSyFInayeOUvK8jLHlM20v9sr9mAptP7efGqym6D0AboViDHe9k742KF7om5m g2duRDuNO5/zSFxH9ZKf//TXBk1Mvg+WB2syhrJ1P1u870jN1WJH7uujqIZf7UAjTDfM cQEzwgv4mcNffHQ0g86F4lZXfWEBaePRNX6Hhgoo7e9Sfnt8pKmkdgP6udX8vy20l/PX TkBgT6/wbO3CjPiS/h9ljD3//uOKJ+0neF5Cng8RZ1zoFTaMwVty3dG8fX86u2Nj/AIn oopg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YBegRkSr; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si2911402pfq.93.2019.08.15.14.25.14; Thu, 15 Aug 2019 14:25:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YBegRkSr; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732266AbfHOVLZ (ORCPT + 99 others); Thu, 15 Aug 2019 17:11:25 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41320 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730865AbfHOVLZ (ORCPT ); Thu, 15 Aug 2019 17:11:25 -0400 Received: by mail-lf1-f68.google.com with SMTP id 62so2587358lfa.8 for ; Thu, 15 Aug 2019 14:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6rHFZp7Q9zNEGDrlZI7ThtXxX4J4GssJHaVlX0BDsnU=; b=YBegRkSr9nfqFrxMWcrxZCGSuYot01qXHOoTtm5wN3VBHueQZiKwl9WSchw77Q+TVJ diHdRMiSGJr/k7xx6YnJCegoZ29R5fc/EOgx0U44Ph81JtctlLRfL3KuiGAvGt04RhUV 1EzhB489KpLuTy17vHo7QbM5pjo5eMPKZECMg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6rHFZp7Q9zNEGDrlZI7ThtXxX4J4GssJHaVlX0BDsnU=; b=CuxhLDN4LHcJyNmmi+V28zKw2J09t5SEJzDfiwGkXpkVUt3HZQxcnVWx/vue5oBKoq pbSdYlzvLAmXcJCLXvUguZRkdyhG/4EuhUYRD5Ku2axDlp2l91x3mI380ABSI7DlO2qC nHAlz05RBRKk08+T9/ZkGaryxTpGckO5gAcLJ3CnZevH5An58I7D+n+gEZln/5rV4hEr rg8v7X/0egz6oCdznkecikqkD6BofGfwiaJIZ5o9KlNJ8vm8jodlOLRNlHZNp7ptlitL gnhO4CC8IJjWvvCvnfJaKpXp0bbKdTUK49n/gUL9l+6c5gg2rIL2kBmC3MK/r1xM6P1b NXIg== X-Gm-Message-State: APjAAAX+4wXN4U31vLVJrthsjx/i3S7rEHEe4r2gAy+DF2OuAkSG7ZHf ls0k6ClpyqtPPFEfZ4p8OPSK9KKjqoo= X-Received: by 2002:ac2:5104:: with SMTP id q4mr3593155lfb.56.1565903482650; Thu, 15 Aug 2019 14:11:22 -0700 (PDT) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id z83sm661602ljb.73.2019.08.15.14.11.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Aug 2019 14:11:21 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id m24so3423522ljg.8 for ; Thu, 15 Aug 2019 14:11:21 -0700 (PDT) X-Received: by 2002:a2e:b0e6:: with SMTP id h6mr3455892ljl.18.1565903481377; Thu, 15 Aug 2019 14:11:21 -0700 (PDT) MIME-Version: 1.0 References: <1564575767-27557-1-git-send-email-yhchuang@realtek.com> <1564575767-27557-3-git-send-email-yhchuang@realtek.com> In-Reply-To: <1564575767-27557-3-git-send-email-yhchuang@realtek.com> From: Brian Norris Date: Thu, 15 Aug 2019 14:11:10 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/3] rtw88: enclose c2h cmd handle with mutex To: Tony Chuang Cc: Kalle Valo , linux-wireless , Stanislaw Gruszka Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org I understand this is already queued up, but I still have a question: On Wed, Jul 31, 2019 at 5:23 AM wrote: > C2H commands that cannot be handled in IRQ context should > be protected by rtwdev->mutex. Because they might have a > sequece of hardware operations that does not want to be > interfered. Can you elaborate on what interference you're looking at, exactly? I'm not a big fan of defensive addition of global locks, and this particular mutex isn't very targeted. It claims to be for mac80211 callbacks, but you use it in quite a few places (some of which clearly don't make sense), and many of them are not related to mac80211 callbacks AFAICT. To the contrary: this handler is called from the mac80211 work queue, which is ordered and therefore shouldn't be getting "interrupted" (e.g., conflicting commands). But then, you added the 'irqsafe' command, which gets run from the ISR...and doesn't hold this lock, obviously. It may well be that you're correct here, but I'd like to see a better explanation for stuff like this. And maybe an update to the rtw_dev::mutex comments. Brian