linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [bug report] mt76: mt7615: wake device before accessing regmap in debugfs
@ 2020-08-04 10:45 dan.carpenter
  2020-08-08 18:01 ` Lorenzo Bianconi
  0 siblings, 1 reply; 2+ messages in thread
From: dan.carpenter @ 2020-08-04 10:45 UTC (permalink / raw)
  To: lorenzo; +Cc: linux-wireless, linux-mediatek

Hello Lorenzo Bianconi,

The patch ea4906c4be49: "mt76: mt7615: wake device before accessing
regmap in debugfs" from Jul 3, 2020, leads to the following static
checker warning:

	drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c:179 mt7615_reset_test_set()
	warn: inconsistent returns 'dev->mt76.mutex'.

drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c
   159  static int
   160  mt7615_reset_test_set(void *data, u64 val)
   161  {
   162          struct mt7615_dev *dev = data;
   163          struct sk_buff *skb;
   164  
   165          if (!mt7615_wait_for_mcu_init(dev))
   166                  return 0;
   167  
   168          mt7615_mutex_acquire(dev);
   169  
   170          skb = alloc_skb(1, GFP_KERNEL);
   171          if (!skb)
   172                  return -ENOMEM;
                        ^^^^^^^^^^^^^^
This is returning with the mutex held.  What is the mutex protecting?
We could move the allocation and the skb_put() before the
mt7615_mutex_acquire().

   173  
   174          skb_put(skb, 1);
   175          mt76_tx_queue_skb_raw(dev, 0, skb, 0);
   176  
   177          mt7615_mutex_release(dev);
   178  
   179          return 0;
   180  }

regards,
dan carpenter

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] mt76: mt7615: wake device before accessing regmap in debugfs
  2020-08-04 10:45 [bug report] mt76: mt7615: wake device before accessing regmap in debugfs dan.carpenter
@ 2020-08-08 18:01 ` Lorenzo Bianconi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Bianconi @ 2020-08-08 18:01 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-wireless, linux-mediatek, Lorenzo Bianconi

>
> Hello Lorenzo Bianconi,
>
> The patch ea4906c4be49: "mt76: mt7615: wake device before accessing
> regmap in debugfs" from Jul 3, 2020, leads to the following static
> checker warning:

Hi Dan,

thx for the report. I will post a fix soon.

Regards,
Lorenzo

>
>         drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c:179 mt7615_reset_test_set()
>         warn: inconsistent returns 'dev->mt76.mutex'.
>
> drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c
>    159  static int
>    160  mt7615_reset_test_set(void *data, u64 val)
>    161  {
>    162          struct mt7615_dev *dev = data;
>    163          struct sk_buff *skb;
>    164
>    165          if (!mt7615_wait_for_mcu_init(dev))
>    166                  return 0;
>    167
>    168          mt7615_mutex_acquire(dev);
>    169
>    170          skb = alloc_skb(1, GFP_KERNEL);
>    171          if (!skb)
>    172                  return -ENOMEM;
>                         ^^^^^^^^^^^^^^
> This is returning with the mutex held.  What is the mutex protecting?
> We could move the allocation and the skb_put() before the
> mt7615_mutex_acquire().
>
>    173
>    174          skb_put(skb, 1);
>    175          mt76_tx_queue_skb_raw(dev, 0, skb, 0);
>    176
>    177          mt7615_mutex_release(dev);
>    178
>    179          return 0;
>    180  }
>
> regards,
> dan carpenter



-- 
UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch;
unzip; touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp;
umount; make clean; sleep

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-08 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-04 10:45 [bug report] mt76: mt7615: wake device before accessing regmap in debugfs dan.carpenter
2020-08-08 18:01 ` Lorenzo Bianconi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).