All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] wifi: ath12k: flush all packets before suspend
@ 2024-05-08 12:29 Dan Carpenter
  2024-05-08 16:51 ` Jeff Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2024-05-08 12:29 UTC (permalink / raw
  To: quic_bqiang; +Cc: linux-wireless, ath12k

Hello Baochen Qiang,

Commit 692921ead832 ("wifi: ath12k: flush all packets before
suspend") from Apr 22, 2024 (linux-next), leads to the following
Smatch static checker warning:

	drivers/net/wireless/ath/ath12k/core.c:58 ath12k_core_suspend()
	warn: sleeping in atomic context

drivers/net/wireless/ath/ath12k/core.c
    48         int ret, i;
    49 
    50         if (!ab->hw_params->supports_suspend)
    51                 return -EOPNOTSUPP;
    52 
    53         rcu_read_lock();
               ^^^^^^^^^^^^^^^
Disables preemption.

    54         for (i = 0; i < ab->num_radios; i++) {
    55                 ar = ath12k_mac_get_ar_by_pdev_id(ab, i);
    56                 if (!ar)
    57                         continue;
--> 58                 ret = ath12k_mac_wait_tx_complete(ar);
                                        ^^^^^^^
Sleeping in atomic context.

    59                 if (ret) {
    60                         ath12k_warn(ab, "failed to wait tx complete: %d\n", ret);
    61                         rcu_read_unlock();
    62                         return ret;
    63                 }
    64         }
    65         rcu_read_unlock();

regards,
dan carpenter

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

* Re: [bug report] wifi: ath12k: flush all packets before suspend
  2024-05-08 12:29 [bug report] wifi: ath12k: flush all packets before suspend Dan Carpenter
@ 2024-05-08 16:51 ` Jeff Johnson
  2024-05-08 17:31   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Johnson @ 2024-05-08 16:51 UTC (permalink / raw
  To: Dan Carpenter, quic_bqiang; +Cc: linux-wireless, ath12k

On 5/8/2024 5:29 AM, Dan Carpenter wrote:
> Hello Baochen Qiang,
> 
> Commit 692921ead832 ("wifi: ath12k: flush all packets before
> suspend") from Apr 22, 2024 (linux-next), leads to the following
> Smatch static checker warning:
> 
> 	drivers/net/wireless/ath/ath12k/core.c:58 ath12k_core_suspend()
> 	warn: sleeping in atomic context

Hi Dan,
I'm not seeing this as part of my standard make W=1 C=1

What do I need to do in order to see this?
build_kernel_data.sh ??



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

* Re: [bug report] wifi: ath12k: flush all packets before suspend
  2024-05-08 16:51 ` Jeff Johnson
@ 2024-05-08 17:31   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-05-08 17:31 UTC (permalink / raw
  To: Jeff Johnson; +Cc: quic_bqiang, linux-wireless, ath12k

On Wed, May 08, 2024 at 09:51:33AM -0700, Jeff Johnson wrote:
> On 5/8/2024 5:29 AM, Dan Carpenter wrote:
> > Hello Baochen Qiang,
> > 
> > Commit 692921ead832 ("wifi: ath12k: flush all packets before
> > suspend") from Apr 22, 2024 (linux-next), leads to the following
> > Smatch static checker warning:
> > 
> > 	drivers/net/wireless/ath/ath12k/core.c:58 ath12k_core_suspend()
> > 	warn: sleeping in atomic context
> 
> Hi Dan,
> I'm not seeing this as part of my standard make W=1 C=1
> 
> What do I need to do in order to see this?
> build_kernel_data.sh ??
>

Yeah.  This is a smatch warning that requires build_kernel_data.sh
(probably you have to build several times which takes forever).  The
might_sleep() is in synchronize_net().

It's better to do run time testing.  If you run with
CONFIG_DEBUG_ATOMIC_SLEEP=y
then it will trigger a stack trace.

regards,
dan carpenter

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

end of thread, other threads:[~2024-05-08 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-08 12:29 [bug report] wifi: ath12k: flush all packets before suspend Dan Carpenter
2024-05-08 16:51 ` Jeff Johnson
2024-05-08 17:31   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.