Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp887166ybt; Wed, 1 Jul 2020 12:30:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/riKGUGNk232IDqKWT7S1YcsbFc3GZxs0tzxbqEOoUGyuHz5UsdQOdz2D5FEIrB3S1zOx X-Received: by 2002:a17:906:c35a:: with SMTP id ci26mr8973252ejb.451.1593631837840; Wed, 01 Jul 2020 12:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593631837; cv=none; d=google.com; s=arc-20160816; b=jivF+pExYdcF45QcW3TZeMriSDLMtM6PsL70nimPv/a6+96SkSKlYB27BgPB6vua93 CFyCXd7/g9IBRPtpF1Pnhg0zuYmkCLI4PAzupW8vHnzUg+zp6eUhlaSVeV5C0inZFvre x5/0UdohwkxTVEeuWpAc97vlnTrdTvVdbbN2CdULju/vHhaYnq0My5haBONjN2N+kSt+ kSOJpfvU9I2lwHyKxRwtoSXMRCLpTlwXycQOxarrQ+mQgRjKyYUmN9cvZyUq5VYn7v5u SJM5+EfS1rUVxI3yeoogGgPzn9OBQVvi1yqLzOEvhJ0PnHDPRYJsbjiP1HNswjw2N5aI bMKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=L6N/mjprbCksaLwamNROOHkzuUAy3hIEqeW1gjm4n5Q=; b=yEm4A1vpLow3ipU0dP9yFliHd5UOjaBlDMmtJAWvLNqYcp7RPQw2L+Uv2VS9u5ZBFa /jZwKllAYdNxhYTL/sIQ07eGIAqMBxHxJnFfiI8KMPM4vNlu2l+bDg/3sEELpi5KC4l8 3zd2fmPTSfrj87YsOHw+uNxUv+Ppd/RAJvp4fo6yf2BIolIhom7XlQZPjvv7j9A4Byn8 amxGMYpqLhtfrrtkGDXrLkesybASKQ85btCl6zod+LuFE+LZZGt9pOHImWrcxahdRv0j +2o1flj3Fhw30aZ4kMMM7XjCXtbPmfO0MgGxDC9JXXXlGHmqvWwzJ2dDhdTRCaMyNXvj 8U8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=LqvgS9eH; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si321029edw.59.2020.07.01.12.29.58; Wed, 01 Jul 2020 12:30:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=LqvgS9eH; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726074AbgGAT07 (ORCPT + 99 others); Wed, 1 Jul 2020 15:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbgGAT06 (ORCPT ); Wed, 1 Jul 2020 15:26:58 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85512C08C5C1 for ; Wed, 1 Jul 2020 12:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=L6N/mjprbCksaLwamNROOHkzuUAy3hIEqeW1gjm4n5Q=; b=LqvgS9eHNcClN87QXlJdLf/f+u UsfRRV5TUMxHgT4/+JWpFYNXJyFhKeUc20yfL3EEpD6HK7R9CT7g0zloFLYmC35YtfKPrqe421qqN tWEO2ADa3mVyhtydMoLp6/bXCRicAMCawZtudRb5AcvhTBynAnptBvZd9bweQA9dZkbA=; Received: from p57a6f545.dip0.t-ipconnect.de ([87.166.245.69] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jqiNe-0002wi-7r; Wed, 01 Jul 2020 21:26:50 +0200 Subject: Re: [PATCH 04/17] mt76: mt7615: introduce mt7615_mutex_{acquire,release} utilities To: Lorenzo Bianconi Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, ryder.lee@mediatek.com, linux-mediatek@lists.infradead.org References: <6a99ada6c2ef43c741bf2c0847e7b11c1d0c68eb.1593204577.git.lorenzo@kernel.org> From: Felix Fietkau Autocrypt: addr=nbd@nbd.name; prefer-encrypt=mutual; keydata= xsDiBEah5CcRBADIY7pu4LIv3jBlyQ/2u87iIZGe6f0f8pyB4UjzfJNXhJb8JylYYRzIOSxh ExKsdLCnJqsG1PY1mqTtoG8sONpwsHr2oJ4itjcGHfn5NJSUGTbtbbxLro13tHkGFCoCr4Z5 Pv+XRgiANSpYlIigiMbOkide6wbggQK32tC20QxUIwCg4k6dtV/4kwEeiOUfErq00TVqIiEE AKcUi4taOuh/PQWx/Ujjl/P1LfJXqLKRPa8PwD4j2yjoc9l+7LptSxJThL9KSu6gtXQjcoR2 vCK0OeYJhgO4kYMI78h1TSaxmtImEAnjFPYJYVsxrhay92jisYc7z5R/76AaELfF6RCjjGeP wdalulG+erWju710Bif7E1yjYVWeA/9Wd1lsOmx6uw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vsUlrvdOLsIgeRGAAn1ee RjMaxwtSdaCKMw3j33ZbsWS4 Message-ID: Date: Wed, 1 Jul 2020 21:26:49 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <6a99ada6c2ef43c741bf2c0847e7b11c1d0c68eb.1593204577.git.lorenzo@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-06-26 23:25, Lorenzo Bianconi wrote: > Introduce mt7615_mutex_{acquire,release} utility routines in order to > switch in full-power/low-power before/after accessing device register-map > > Signed-off-by: Lorenzo Bianconi > --- > .../net/wireless/mediatek/mt76/mt7615/mac.c | 12 +-- > .../net/wireless/mediatek/mt76/mt7615/main.c | 83 ++++++++++--------- > .../net/wireless/mediatek/mt76/mt7615/mcu.c | 5 +- > .../wireless/mediatek/mt76/mt7615/mt7615.h | 18 ++++ > .../net/wireless/mediatek/mt76/mt7615/usb.c | 11 +-- > .../wireless/mediatek/mt76/mt7615/usb_mcu.c | 4 +- > 6 files changed, 79 insertions(+), 54 deletions(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c > index 4d8cd88473dd..8910604719b1 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c > @@ -1530,7 +1530,7 @@ void mt7615_mac_set_scs(struct mt7615_phy *phy, bool enable) > bool ext_phy = phy != &dev->phy; > u32 reg, mask; > > - mutex_lock(&dev->mt76.mutex); > + mt7615_mutex_acquire(dev, &dev->mt76.mutex); I think we should use this wrapper only in places where we acquire dev->mt76.mutex This would also make it possible to drop the second argument to the wrapper function. - Felix