From patchwork Fri Jun 26 21:25:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 11628759 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FA7914F6 for ; Fri, 26 Jun 2020 21:25:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA52520B80 for ; Fri, 26 Jun 2020 21:25:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iz7VshqN"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="DWN/3Twx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA52520B80 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BQuc7Lio01PqzSVjyJyStN2TxjJAskZqvVGgds3I5Ag=; b=iz7VshqNb/FYc+P86oz6Zu44W eX45v4v4Q66wAFQUW14MD7tDM5y9i8zMBIqgO/cGk81iMxUzFqm2sT+ycr/YCK8Z9Lsg0l7Kj8GbX cz8bf9x/nXFlGUynH3hxkl/QJpQSXJc2AeMnKY6icuif/0H4oLqvqdmwEzA6kLSZupGnnmYfJ/1YG YkFSVTl8B1qJ4xraTWQUIQAgfUyDVO9iJSHY9TdAmeXRKwVrNLuseVVLm/O1095hFR0c1rT+YXg7i WEMYMLCmEH8ZUYZsPeKU0ar/mfCf9qwrVT7jdI9Mse0qwqmQrv4amAExvgjnjfxs19s1F9FjqMJKD SfbjBli/Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jovqy-0001yX-Ja; Fri, 26 Jun 2020 21:25:44 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jovqw-0001x3-7z for linux-mediatek@lists.infradead.org; Fri, 26 Jun 2020 21:25:42 +0000 Received: from localhost.localdomain.com (unknown [151.48.138.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A94120B1F; Fri, 26 Jun 2020 21:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593206741; bh=tuLy4ShzWJs5sATRkIvM4SMsEx6NlrCEvROfr7GG5zA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DWN/3TwxAZ6w6DqupEkMRvnpF8ozFPuAn7ukJ1OYdI0bsB2wGtGtFKHU0SfU4XVO9 UyHaHN+lydu6jnatPKNbaaTr6FDXSGtDmR2o9wgNyP2qqm3V4J9tyuvzkG/2KmCfMH 4pLlaKuHVM4l+8JMVJUs+D8ElcEidkb1IuXs75o0= From: Lorenzo Bianconi To: nbd@nbd.name Subject: [PATCH 05/17] mt76: mt7615: wake device before accessing regmap in debugfs Date: Fri, 26 Jun 2020 23:25:05 +0200 Message-Id: <4ad493ebe2a26e709c50edf16d29a310f57d8fcf.1593204577.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mediatek@lists.infradead.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Make sure the device is in full-power before reading regs in debugfs Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c index 8bb7c64db738..b4c196005ebf 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c @@ -167,9 +167,13 @@ mt7615_ampdu_stat_read(struct seq_file *file, void *data) { struct mt7615_dev *dev = file->private; + mt7615_mutex_acquire(dev, &dev->mt76.mutex); + mt7615_ampdu_stat_read_phy(&dev->phy, file); mt7615_ampdu_stat_read_phy(mt7615_ext_phy(dev), file); + mt7615_mutex_release(dev, &dev->mt76.mutex); + return 0; } @@ -233,6 +237,8 @@ mt7615_queues_acq(struct seq_file *s, void *data) struct mt7615_dev *dev = dev_get_drvdata(s->private); int i; + mt7615_mutex_acquire(dev, &dev->mt76.mutex); + for (i = 0; i < 16; i++) { int j, wmm_idx = i % MT7615_MAX_WMM_SETS; int acs = i / MT7615_MAX_WMM_SETS; @@ -253,6 +259,8 @@ mt7615_queues_acq(struct seq_file *s, void *data) seq_printf(s, "AC%d%d: queued=%d\n", wmm_idx, acs, qlen); } + mt7615_mutex_release(dev, &dev->mt76.mutex); + return 0; }