[PATCH 04/17] mt76: mt7615: introduce mt7615_mutex_{acquire,release} utilities

Felix Fietkau nbd at nbd.name
Wed Jul 1 15:26:49 EDT 2020


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 <lorenzo at kernel.org>
> ---
>  .../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



More information about the Linux-mediatek mailing list